This commit is contained in:
2021-08-12 15:07:12 +08:00
parent 6ea406251c
commit 0d6176e4e2
13 changed files with 141 additions and 302 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Server\Constrict;
use Kiri\Exception\NotFindClassException;
use Server\ResponseInterface;
use Swoole\WebSocket\Server;
/**
*
*/
class WebSocketEmitter implements Emitter
{
/**
* @param Server $response
* @param ResponseInterface $emitter
* @throws NotFindClassException
* @throws \ReflectionException
* @throws \Exception
*/
public function sender(Server $response, ResponseInterface $emitter)
{
$response->push($emitter->getClientId(), $emitter->getContent()->getData());
}
}