Files
kiri-core/http-server/Constrict/WebSocketEmitter.php
T

28 lines
494 B
PHP
Raw Normal View History

2021-08-12 15:07:12 +08:00
<?php
namespace Server\Constrict;
use Kiri\Exception\NotFindClassException;
use Server\ResponseInterface;
/**
*
*/
class WebSocketEmitter implements Emitter
{
/**
2021-08-12 15:08:46 +08:00
* @param mixed $response
2021-08-12 15:07:12 +08:00
* @param ResponseInterface $emitter
* @throws NotFindClassException
* @throws \ReflectionException
* @throws \Exception
*/
2021-08-12 15:08:46 +08:00
public function sender(mixed $response, ResponseInterface $emitter): void
2021-08-12 15:07:12 +08:00
{
$response->push($emitter->getClientId(), $emitter->getContent()->getData());
}
}