class PusherPubSubIncomingMessageHandler implements PubSubIncomingMessageHandler

Properties

protected array<string, list<callable>> $events

Registered event listeners.

Methods

void
handle(string $payload)

Handle an incoming message from the pub/sub provider.

void
handleMessage(array $event)

Handle a broadcast message from another node.

void
handleMetricsRequest(array $event)

Handle a metrics request from another node.

void
handleTerminate(array $event)

Terminate all connections for the given user.

resolveApplication(string $appId)

Resolve the application instance from an app ID.

void
processEventListeners(array $event)

Process the given event through registered listeners.

void
listen(string $event, callable $callback)

Listen for the given event.

void
stopListening(string $event)

Stop listening for the given event.

Details

at line 27
void handle(string $payload)

Handle an incoming message from the pub/sub provider.

Uses scalar payloads — resolves Application from ApplicationProvider instead of unserializing objects.

Parameters

string $payload

Return Value

void

at line 47
protected void handleMessage(array $event)

Handle a broadcast message from another node.

Parameters

array $event

Return Value

void

at line 78
protected void handleMetricsRequest(array $event)

Handle a metrics request from another node.

Parameters

array $event

Return Value

void

at line 95
protected void handleTerminate(array $event)

Terminate all connections for the given user.

Parameters

array $event

Return Value

void

at line 110
protected Application resolveApplication(string $appId)

Resolve the application instance from an app ID.

Parameters

string $appId

Return Value

Application

at line 118
protected void processEventListeners(array $event)

Process the given event through registered listeners.

Parameters

array $event

Return Value

void

at line 132
void listen(string $event, callable $callback)

Listen for the given event.

Parameters

string $event
callable $callback

Return Value

void

at line 140
void stopListening(string $event)

Stop listening for the given event.

Parameters

string $event

Return Value

void