unregister #
Available since 2.7.2
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);
}
Edit this page on Github(opens new window)