Skip to content

Commit 104ea1b

Browse files
committed
Added README.md.
Signed-off-by: Pavel Kirilin <win10@list.ru>
1 parent 2ed173b commit 104ea1b

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
# taskiq_aiohttp
1+
# Taskiq + AioHTTP
2+
3+
This project is used to create mocked application and request
4+
that you can use as a dependencies in your taskiq application.
5+
6+
7+
It's useful because it runs all startup events of your application
8+
and everything that you might expect in your application's state is
9+
available inside of your tasks.
10+
11+
We suggest to use this library along with [taskiq-python/aiohttp-deps](https://github.com/taskiq-python/aiohttp-deps), because it might be super handy to reuse same dependencies of your application in your tasks.
12+
13+
To add an integration, you need to call the function `init` in your broker's module.
14+
15+
```python
16+
import taskiq_aiohttp
17+
18+
broker = ...
19+
20+
taskiq_aiohttp.init(broker, "project.module:app")
21+
22+
```
23+
24+
## How does it work?
25+
26+
It adds startup functions to the broker, so it imports your aiohttp application and creates a single worker-wide Request and Application objects that you can depend on.
27+
28+
THIS REQUEST IS NOT RELATED TO THE ACTUAL REQUESTS IN AioHTTP! This request won't have actual data about the request you were handling while sending a task.

0 commit comments

Comments
 (0)