method

RedisClient.unsubscribe

channel: string
): Promise<void>;

Unsubscribe from a single Redis channel.

If there are no more channels subscribed to, the client automatically re-enables pipelining if it was previously enabled.

Once all channels have been unsubscribed from, the client leaves the subscription state. For further details on the subscription state, see .subscribe().

@param channel

The channel to unsubscribe from.

channel: string,
): Promise<void>;

Remove a listener from a given Redis channel.

If there are no more channels subscribed to, the client automatically re-enables pipelining if it was previously enabled.

Once all channels have been unsubscribed from, the client leaves the subscription state. For further details on the subscription state, see .subscribe().

@param channel

The channel to unsubscribe from.

@param listener

The listener to remove. This is tested against referential equality so you must pass the exact same listener instance as when subscribing.

unsubscribe(): Promise<void>;

Unsubscribe from all registered Redis channels.

The client automatically re-enables pipelining if it was previously enabled.

Once all channels have been unsubscribed from, the client leaves the subscription state. For further details on the subscription state, see .subscribe().

channels: string[]
): Promise<void>;

Unsubscribe from multiple Redis channels.

If there are no more channels subscribed to, the client automatically re-enables pipelining if it was previously enabled.

Once all channels have been unsubscribed from, the client leaves the subscription state. For further details on the subscription state, see .subscribe().

@param channels

An array of channels to unsubscribe from.

Referenced types

type StringPubSubListener = (message: string, channel: string) => void