Skip to content

Instance Method

unsubscribe(from:)

Unsubscribes the client from a specific Redis channel from receiving any future published messages.
func unsubscribe(from channels: [RedisChannelName]) -> EventLoopFuture<Void>

Parameters

channels

A list of channel names to be unsubscribed from.

Return Value

A notification NIO.EventLoopFuture that resolves once the subscription(s) have been removed from Redis.

Discussion

See UNSUBSCRIBE

Note

If the channel was not subscribed to with subscribe(to:messageReceiver:onSubscribe:onUnsubscribe:), then this method has no effect.

Important

If no more subscriptions (pattern or channel) are active on the client, the client will be taken out of its “PubSub mode”.

It will then be allowed to use any command like normal.

See the PubSub specification