Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.12 KB

File metadata and controls

51 lines (35 loc) · 1.12 KB
code type title description
true
page
unregister | Framework | Core
Subscription class unregister() method

unregister

Removes a realtime subscription on an existing roomId and connectionId. The client listening on the given connection for the given room will stop receiving notifications.


Arguments

unregister(connectionId: string, roomId: string, notify: boolean): Promise<void>

Argument Type Description
connectionId
string
The id of the connection associated to the subscription
roomId
string
The id of the room associated to the subscription
notify
boolean
Whether to notify or not the other clients in the room that one client stopped listening

Return

Resolves to void.


Example

async unregisterSubscription (request) {
  const connectionId = request.context.connection.id;
  const roomId = request.input.body.roomId;

  await this.context.accessors.subscription.unregister(
    connectionId, 
    roomId, 
    false);
}