class EventHandler

Methods

__construct(ChannelManager $channels)

Create a new Pusher event instance.

void
handle(Connection $connection, string $event, array $payload = [])

Handle an incoming Pusher event.

void
acknowledge(Connection $connection)

Acknowledge the connection.

void
subscribe(Connection $connection, string $channel, string|null $auth = null, string|null $data = null)

Subscribe to the given channel.

void
afterSubscribe(Channel $channel, Connection $connection)

Carry out any actions that should be performed after a subscription.

void
unsubscribe(Connection $connection, string $channel)

Unsubscribe from the given channel.

void
sendCachedPayload(CacheChannel $channel, Connection $connection)

Send the cached payload for the given channel.

void
pong(Connection $connection)

Respond to a ping on the given connection.

void
ping(Connection $connection)

Send a ping to the given connection.

void
send(Connection $connection, string $event, array $data = [], string|null $channel = null)

Send a response to the given connection.

void
sendInternally(Connection $connection, string $event, array $data = [], string|null $channel = null)

Send an internal response to the given connection.

string
formatPayload(string $event, array $data = [], string|null $channel = null, string $prefix = 'pusher:')

Format the payload for the given event.

string
formatInternalPayload(string $event, array $data = [], string|null $channel = null)

Format the internal payload for the given event.

Details

at line 23
__construct(ChannelManager $channels)

Create a new Pusher event instance.

Parameters

ChannelManager $channels

at line 30
void handle(Connection $connection, string $event, array $payload = [])

Handle an incoming Pusher event.

Parameters

Connection $connection
string $event
array $payload

Return Value

void

at line 69
void acknowledge(Connection $connection)

Acknowledge the connection.

Parameters

Connection $connection

Return Value

void

at line 80
void subscribe(Connection $connection, string $channel, string|null $auth = null, string|null $data = null)

Subscribe to the given channel.

Parameters

Connection $connection
string $channel
string|null $auth
string|null $data

Return Value

void

at line 114
protected void afterSubscribe(Channel $channel, Connection $connection)

Carry out any actions that should be performed after a subscription.

Parameters

Channel $channel
Connection $connection

Return Value

void

at line 127
void unsubscribe(Connection $connection, string $channel)

Unsubscribe from the given channel.

Parameters

Connection $connection
string $channel

Return Value

void

at line 138
protected void sendCachedPayload(CacheChannel $channel, Connection $connection)

Send the cached payload for the given channel.

Parameters

CacheChannel $channel
Connection $connection

Return Value

void

at line 162
void pong(Connection $connection)

Respond to a ping on the given connection.

Parameters

Connection $connection

Return Value

void

at line 170
void ping(Connection $connection)

Send a ping to the given connection.

Parameters

Connection $connection

Return Value

void

at line 182
void send(Connection $connection, string $event, array $data = [], string|null $channel = null)

Send a response to the given connection.

Parameters

Connection $connection
string $event
array $data
string|null $channel

Return Value

void

at line 192
void sendInternally(Connection $connection, string $event, array $data = [], string|null $channel = null)

Send an internal response to the given connection.

Parameters

Connection $connection
string $event
array $data
string|null $channel

Return Value

void

at line 202
string formatPayload(string $event, array $data = [], string|null $channel = null, string $prefix = 'pusher:')

Format the payload for the given event.

Parameters

string $event
array $data
string|null $channel
string $prefix

Return Value

string

at line 217
string formatInternalPayload(string $event, array $data = [], string|null $channel = null)

Format the internal payload for the given event.

Parameters

string $event
array $data
string|null $channel

Return Value

string