By Admin on Thursday, 14 April 2022
Category: All

Pusher Cache Channels

​From sgcWebSockets 2022.4.0 the Pusher Cache Channels are supported. Currently the following Cache channels are available:

Cache Channels 

A cache channel remembers the last triggered event, and sends this as the first event to new subscribers.

When an event is triggered on a cache channel, Pusher Channels caches this event, and when a client subscribes to a cache channel, if a cached value exists, this is sent to the client as the first event on that channel. This behavior helps developers to provide the initial state without adding additional logic to fetch it from elsewhere. 

Example: subscribe to public cache channel "my-cache-channel".

APIPusher.Subscribe('my-cache-channel', pscCacheChannel);

If you are subscribed successfully OnPusherSubscribe event will be raised, if there is an error you will get a message in OnPusherError event.

All messages from the subscribed channel will be received OnPusherEvent event

Related Posts