A Redis client: commands and scripts on shared connections,
subscriptions, and connections of its own (reserve).
Attributes#
| Attribute | Type | Description |
|---|---|---|
reserve | Effect[RedisConnection, RedisError, Scope] | A connection for this scope alone, for blocking commands
( |
Functions#
subscribe#
subscribe(channel, *, capacity=DEFAULT_SUBSCRIBE_CAPACITY) -> Effect[Dequeue[RedisMessage, RedisError], Never, Scope]Messages published to channel until the scope closes; a
failed subscription fails the dequeue. The dequeue holds at most
capacity messages not yet taken; one more fails it (after
those) with an error saying the subscriber fell behind.
| Parameter | Type | Description |
|---|---|---|
channel | str | |
capacity | int = DEFAULT_SUBSCRIBE_CAPACITY |
Returns Effect[Dequeue[RedisMessage, RedisError], Never, Scope]
def subscribe(
self, channel: str, *, capacity: int = DEFAULT_SUBSCRIBE_CAPACITY
) -> Effect[Dequeue[RedisMessage, RedisError], Never, Scope]:
"""Messages published to ``channel`` until the scope closes; a
failed subscription fails the dequeue. The dequeue holds at most
``capacity`` messages not yet taken; one more fails it (after
those) with an error saying the subscriber fell behind."""
...send#
send(command, *args) -> Effect[RedisReply, RedisError]Send command with args and give its reply.
| Parameter | Type | Description |
|---|---|---|
command | str | |
args | str = () |
Returns Effect[RedisReply, RedisError]
def send(self, command: str, *args: str) -> Effect[RedisReply, RedisError]:
"""Send ``command`` with ``args`` and give its reply."""
...eval#
eval[**P, A](script) -> Callable[P, Effect[A, RedisError]]A function running script with EVALSHA, loading it first
(and again when Redis answers NOSCRIPT).
| Parameter | Type | Description |
|---|---|---|
script | Script[P, A] |
Returns Callable[P, Effect[A, RedisError]]
def eval[**P, A](self, script: Script[P, A]) -> Callable[P, Effect[A, RedisError]]:
"""A function running ``script`` with ``EVALSHA``, loading it first
(and again when Redis answers ``NOSCRIPT``)."""
...