code | type | title | description |
---|---|---|---|
true |
page |
unregister | Framework | Core |
Subscription class unregister() method |
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.
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 |
Resolves to void.
async unregisterSubscription (request) {
const connectionId = request.context.connection.id;
const roomId = request.input.body.roomId;
await this.context.accessors.subscription.unregister(
connectionId,
roomId,
false);
}