MCPcopy
hub / github.com/redis/redis-py / punsubscribe

Method punsubscribe

redis/asyncio/client.py:1357–1370  ·  view source on GitHub ↗

Unsubscribe from the supplied patterns. If empty, unsubscribe from all patterns.

(self, *args: ChannelT)

Source from the content-addressed store, hash-verified

1355 return ret_val
1356
1357 def punsubscribe(self, *args: ChannelT) -> Awaitable:
1358 """
1359 Unsubscribe from the supplied patterns. If empty, unsubscribe from
1360 all patterns.
1361 """
1362 patterns: Iterable[ChannelT]
1363 if args:
1364 parsed_args = list_or_args((args[0],), args[1:])
1365 patterns = self._normalize_keys(dict.fromkeys(parsed_args)).keys()
1366 else:
1367 parsed_args = []
1368 patterns = self.patterns
1369 self.pending_unsubscribe_patterns.update(patterns)
1370 return self.execute_command("PUNSUBSCRIBE", *parsed_args)
1371
1372 async def subscribe(
1373 self, *args: ChannelT | Subscription, **kwargs: PubSubHandler

Callers 2

_execute_unsubscribeMethod · 0.45

Calls 5

_normalize_keysMethod · 0.95
execute_commandMethod · 0.95
list_or_argsFunction · 0.90
keysMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected