The redis-py client behind Redis: client itself (to call on
its loop), and use(f), running f(client) there.
Attributes#
| Attribute | Type | Description |
|---|---|---|
client | AsyncRedis |
Functions#
__init__#
__init__(client, _loop) -> None| Parameter | Type | Description |
|---|---|---|
client | AsyncRedis | |
_loop | _Loop |
use#
use[A](f) -> Effect[A, RedisError]Run f(client) on the client's loop; its error becomes a
RedisError.
| Parameter | Type | Description |
|---|---|---|
f | Callable[[AsyncRedis], Awaitable[A]] |
Returns Effect[A, RedisError]
def use[A](self, f: Callable[[AsyncRedis], Awaitable[A]]) -> Effect[A, RedisError]:
"""Run ``f(client)`` on the client's loop; its error becomes a
``RedisError``."""
async def run() -> A:
return await f(self.client)
return self._loop.run(run, waits_for="work")