Munsubscribe
Bun

method

RedisClient.unsubscribe

channel: string
): Promise<void>;

Unsubscribe from a singular Redis channel.

@param channel

The channel to unsubscribe from.

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

Unsubscribing moves the channel back to a normal state out of the subscription state if all channels have been unsubscribed from. For further details on the subscription state, see .subscribe().

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.

Unsubscribing moves the channel back to a normal state out of the subscription state if all channels have been unsubscribed from. 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 will automatically re-enable pipelining if it was previously enabled.

Unsubscribing moves the channel back to a normal state out of the subscription state if all channels have been unsubscribed from. For further details on the subscription state, see .subscribe().

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

Unsubscribe from multiple Redis channels.

@param channels

An array of channels to unsubscribe from.

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

Unsubscribing moves the channel back to a normal state out of the subscription state if all channels have been unsubscribed from. For further details on the subscription state, see .subscribe().

Referenced types

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