AsyncPubSubClient¶
Bases: Subscribe
Asynchronous Redis Publish/Subscribe Client.
Supports channel subscription, unsubscription, pattern-based subscriptions, and listening for incoming messages asynchronously.
Source code in pyredis/client/async_pubsub.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
closed
property
¶
Flag indicating if the connection is closed.
__init__(**kwargs)
¶
Initialize the AsyncPubSubClient connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Connection options forwarded to AsyncConnection. |
{}
|
Source code in pyredis/client/async_pubsub.py
13 14 15 16 17 18 19 20 | |
close()
async
¶
Close the underlying connection asynchronously.
Source code in pyredis/client/async_pubsub.py
22 23 24 | |
get()
async
¶
Read the next message/response from the connection asynchronously.
Returns:
| Type | Description |
|---|---|
|
The message or response read from Redis. |
Source code in pyredis/client/async_pubsub.py
40 41 42 43 44 45 46 47 | |
psubscribe(*args)
¶
Source code in pyredis/commands/subscribe.py
7 8 9 10 | |
punsubscribe(*args)
¶
Source code in pyredis/commands/subscribe.py
12 13 14 15 | |
subscribe(*args)
¶
Source code in pyredis/commands/subscribe.py
17 18 19 20 | |
unsubscribe(*args)
¶
Source code in pyredis/commands/subscribe.py
22 23 24 25 | |
write(*args)
async
¶
Write a command to the underlying connection asynchronously.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Command name and arguments. |
()
|
Source code in pyredis/client/async_pubsub.py
31 32 33 34 35 36 37 38 | |