class EventPusher implements MessageComponentInterface

Constants

KEEP_ALIVE

Max pong time and interval between pings in seconds

Methods

__construct(LoopInterface $loop, OutputInterface $output = null)

Create a new event pusher handler

onOpen(ConnectionInterface $conn)

Open the connection

onMessage(ConnectionInterface $from, mixed $msg)

Send a message as a client

onClose(ConnectionInterface $conn)

Close a connection

onError(ConnectionInterface $conn, Exception $e)

Action to call on an error

onServerEvent(string $event)

Action to call when the server notifies us about something

ping()

Send a ping message to all clients and kick those who didn't respond

Details

at line line 47
__construct(LoopInterface $loop, OutputInterface $output = null)

Create a new event pusher handler

Parameters

LoopInterface $loop
OutputInterface $output

at line line 63
onOpen(ConnectionInterface $conn)

Open the connection

Parameters

ConnectionInterface $conn

at line line 88
onMessage(ConnectionInterface $from, mixed $msg)

Send a message as a client

Parameters

ConnectionInterface $from
mixed $msg

at line line 100
onClose(ConnectionInterface $conn)

Close a connection

Parameters

ConnectionInterface $conn

at line line 118
onError(ConnectionInterface $conn, Exception $e)

Action to call on an error

Parameters

ConnectionInterface $conn
Exception $e

at line line 219
onServerEvent(string $event)

Action to call when the server notifies us about something

Parameters

string $event JSON'ified string we'll receive from the webserver

at line line 260
ping()

Send a ping message to all clients and kick those who didn't respond