EventHandler
class EventHandler
Methods
Subscribe to the given channel.
Carry out any actions that should be performed after a subscription.
Send the cached payload for the given channel.
Send a response to the given connection.
Send an internal response to the given connection.
Format the payload for the given event.
Format the internal payload for the given event.
Details
at line 23
__construct(ChannelManager $channels)
Create a new Pusher event instance.
at line 30
void
handle(Connection $connection, string $event, array $payload = [])
Handle an incoming Pusher event.
at line 69
void
acknowledge(Connection $connection)
Acknowledge the connection.
at line 80
void
subscribe(Connection $connection, string $channel, string|null $auth = null, string|null $data = null)
Subscribe to the given channel.
at line 114
protected void
afterSubscribe(Channel $channel, Connection $connection)
Carry out any actions that should be performed after a subscription.
at line 127
void
unsubscribe(Connection $connection, string $channel)
Unsubscribe from the given channel.
at line 138
protected void
sendCachedPayload(CacheChannel $channel, Connection $connection)
Send the cached payload for the given channel.
at line 162
void
pong(Connection $connection)
Respond to a ping on the given connection.
at line 170
void
ping(Connection $connection)
Send a ping to the given connection.
at line 182
void
send(Connection $connection, string $event, array $data = [], string|null $channel = null)
Send a response to the given connection.
at line 192
void
sendInternally(Connection $connection, string $event, array $data = [], string|null $channel = null)
Send an internal response to the given connection.
at line 202
string
formatPayload(string $event, array $data = [], string|null $channel = null, string $prefix = 'pusher:')
Format the payload for the given event.
at line 217
string
formatInternalPayload(string $event, array $data = [], string|null $channel = null)
Format the internal payload for the given event.