Realtime Cloud Storage

Channel

class Channel

A logical path through which information is exchanged in an isolated way. Only users subscribing a certain channel will receive the information being broadcasted through it.

Properties

Function messageAdapter

Callback handler that allow changes to be made to the message. Called when a message arrives through the channel.

String name

Name of the channel.

Boolean subscribe

Indicates if the channel is to be subscribed as soon as it's added to the connection. {@default true}

Boolean subscribeOnReconnect

Indicates if the channels subscription is automatically made in case there's a reconnect. {@default true}

Events

void message(Object e)

Fired when a subscribed channel receives a message.

Parameters

Object e

structure with the definition of the event's parameters.

Properties

String message

message that was received.

void subscribe(Object e)

Fired when a channel subscribes to the connection. Starts listening for incoming messages.

Parameters

Object e

structure with the definition of the event's parameters.

Properties

String message

message that was received.

void unsubscribe(Object e)

Fired when a channel unsubscribes from the connection. Stops listening for incoming messages.

Parameters

Object e

structure with the definition of the event's parameters.

Properties

String message

message that was received.