SyncRedisCommandQueue
Sync Redis command queue.
SyncRedisCommandQueue
¶
SyncRedisCommandQueue
- Асинхронный класс для работы с Redis
.
Пример¶
from qtasks import QueueTasks
from qtasks.contrib.redis import SyncRedisCommandQueue
redis_contrib = SyncRedisCommandQueue(redis)
redis_contrib.execute("hset", kwargs["name"], mapping=kwargs["mapping"])
__init__(redis, log=None)
¶
Экземпляр класса.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
redis
|
Redis
|
класс |
required |
log
|
Logger
|
класс |
None
|
execute(cmd, *args, **kwargs)
¶
Запрос в Redis
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cmd
|
str
|
Команда. |
required |
args(tuple,
|
optional
|
Параметры к команде через *args. |
required |
kwargs(dict,
|
optional
|
Параметры к команде через *args. |
required |