python-dependency-injector/examples/miniapps/fastapi-redis/fastapiredis/services.py
Yan f0d9eda566
Update aioredis to 2.0.1 (#613)
* Update aioredis to 2.0.1

* Rearranged aioredis.from_url parameters
2022-12-18 21:27:36 -05:00

13 lines
275 B
Python

"""Services module."""
from aioredis import Redis
class Service:
def __init__(self, redis: Redis) -> None:
self._redis = redis
async def process(self) -> str:
await self._redis.set("my-key", "value")
return await self._redis.get("my-key")