Skip to content

Commit 8cceb45

Browse files
committed
Merge tag '0.0.2' into develop
0.0.2
2 parents e41a1c3 + 5861510 commit 8cceb45

File tree

2 files changed

+77
-3
lines changed

2 files changed

+77
-3
lines changed

README.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,63 @@
1-
## TaskIQ-Redis
1+
# TaskIQ-Redis
2+
3+
Taskiq-redis is a plugin for taskiq that adds a new broker and result backend based on redis.
4+
5+
# Installation
6+
7+
To use this project you must have installed core taskiq library:
8+
```bash
9+
pip install taskiq
10+
```
11+
This project can be installed using pip:
12+
```bash
13+
pip install taskiq-redis
14+
```
15+
16+
# Usage
17+
18+
Let's see the example with the redis broker and redis async result:
19+
```python
20+
import asyncio
21+
22+
from taskiq_redis.redis_broker import RedisBroker
23+
from taskiq_redis.redis_backend import RedisAsyncResultBackend
24+
25+
26+
redis_async_result = RedisAsyncResultBackend(
27+
url="redis://localhost:6379",
28+
)
29+
30+
broker = RedisBroker(
31+
url="redis://localhost:6379",
32+
result_backend=redis_async_result,
33+
)
34+
35+
36+
@broker.task
37+
async def best_task_ever() -> None:
38+
"""Solve all problems in the world."""
39+
await asyncio.sleep(5.5)
40+
print("All problems are solved!")
41+
42+
43+
async def main():
44+
task = await my_async_task.kiq()
45+
print(await task.get_result())
46+
47+
48+
asyncio.run(main())
49+
```
50+
51+
## RedisBroker configuration
52+
53+
RedisBroker parameters:
54+
* `url` - url to redis.
55+
* `task_id_generator` - custom task_id genertaor.
56+
* `result_backend` - custom result backend.
57+
* `queue_name` - name of the pub/sub channel in redis.
58+
* `max_connection_pool_size` - maximum number of connections in pool.
59+
60+
## RedisAsyncResultBackend configuration
61+
62+
RedisAsyncResultBackend parameters:
63+
* `url` - url to redis.

pyproject.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
[tool.poetry]
22
name = "taskiq-redis"
3-
version = "0.0.1"
3+
version = "0.0.2"
44
description = "Redis integration for taskiq"
55
authors = ["taskiq-team <[email protected]>"]
6-
6+
readme = "README.md"
7+
classifiers = [
8+
"Programming Language :: Python",
9+
"Programming Language :: Python :: 3",
10+
"Programming Language :: Python :: 3 :: Only",
11+
"Programming Language :: Python :: 3.7",
12+
"Programming Language :: Python :: 3.8",
13+
"Programming Language :: Python :: 3.9",
14+
"Programming Language :: Python :: 3.10",
15+
]
16+
homepage = "https://github.com/taskiq-python/taskiq-redis"
17+
repository = "https://github.com/taskiq-python/taskiq-redis"
18+
keywords = ["taskiq", "tasks", "distributed", "async", "redis", "result_backend"]
719

820
[tool.poetry.dependencies]
921
python = "^3.7"

0 commit comments

Comments
 (0)