Channels & presence

Subscription

A subscription is an active registration to receive events from a channel. Its lifecycle includes requesting access, confirming success and eventually leaving the channel.

Also found under: Subscribe, Unsubscribe, Subscription lifecycle

How it works

Opening a connection and subscribing are separate actions. An open socket does not prove that a restricted subscription succeeded. Applications should handle subscription errors, clean up unused listeners and restore the subscriptions they still need after a connection is replaced.

In a Pubb integration

Pubb clients subscribe by channel name and can unsubscribe when a screen no longer needs updates. Private and presence subscriptions require authorization; a successful presence subscription also supplies membership information.

Connect a client

A practical example

When a user switches from project 42 to project 81, remove the old project's subscription and subscribe to the new project's authorized channel.