Skip to content

Commit 6441c59

Browse files
committed
Merge branch 'release/0.10.3'
2 parents 9a6e49f + cb72734 commit 6441c59

File tree

32 files changed

+2123
-1964
lines changed

32 files changed

+2123
-1964
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
strategy:
3838
matrix:
3939
py_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
40+
pydantic_ver: ["<2", ">=2,<3"]
4041
os: [ubuntu-latest, windows-latest]
4142
runs-on: "${{ matrix.os }}"
4243
steps:
@@ -50,6 +51,8 @@ jobs:
5051
cache: "poetry"
5152
- name: Install deps
5253
run: poetry install --all-extras
54+
- name: Setup pydantic version
55+
run: poetry run pip install "pydantic ${{ matrix.pydantic_ver }}"
5356
- name: Run pytest check
5457
run: poetry run pytest -vv -n auto --cov="taskiq" .
5558
- name: Generate report

docs/available-components/brokers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It's suitable for small projects with only ONE worker process, because of the ZM
2020
It publishes messages on the local port. All worker processes are reading messages from this port.
2121
If you run many worker processes, all tasks will be executed `N` times, where `N` is the total number of worker processes.
2222

23-
::: danger Be careful!
23+
::: caution Be careful!
2424
If you choose this type of broker, please run taskiq with `-w 1` parameter,
2525
otherwise you may encounter undefined behavior.
2626
:::

docs/examples/extending/schedule_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Coroutine, List
1+
from typing import List
22

33
from taskiq import ScheduledTask, ScheduleSource
44

docs/extending-taskiq/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ All abstract classes can be found in `taskiq.abc` package.
1414

1515
- [Brokers](./broker.md)
1616
- [Middlewares](./middleware.md)
17-
- [Result backends](./resutl-backend.md)
17+
- [Result backends](./result-backend.md)
1818
- [CLI](./cli.md)
1919
- [Schedule sources](./schedule-sources.md)

docs/extending-taskiq/middleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 2
66

77
Middlewares are super helpful. You can inject some code before or after task's execution.
88

9-
Middlewares must implement `taskiq.abc.middleware.TaskiqMiddleware` abstract class.
9+
Middlewares must implement [`taskiq.abc.middleware.TaskiqMiddleware`](https://github.com/taskiq-python/taskiq/blob/master/taskiq/abc/middleware.py) abstract class.
1010
Every method of a middleware can be either sync or async. Taskiq will execute it
1111
as you expect.
1212

docs/extending-taskiq/resutl-backend.md renamed to docs/extending-taskiq/result-backend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ It's a good practice to skip fetching logs from the storage unless `with_logs=Tr
1616
:::
1717

1818

19-
::: danger Important note!
19+
::: caution Important note!
2020
`with_logs` param is now deprecated. It will be removed in future releases.
2121
:::

docs/guide/architecture-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you use dark theme and cannot see words on diagram,
1515
try switching to light theme and back to dark.
1616
:::
1717

18-
```sequence
18+
```mermaid
1919
rect rgb(191, 223, 255)
2020
note right of Your code: Client side.
2121
Your code ->> Kicker: assemble message

docs/guide/cli.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ We have two options for this:
2929
It's a name of files to import. By default is searches for all `tasks.py` files.
3030
- `--fs-discover` or `-fsd`. This option enables search of task files in current directory recursively, using the given pattern.
3131

32+
### Acknowledgements
33+
34+
The taskiq supports three types of acknowledgements:
35+
* `when_received` - task is acknowledged when it is **received** by the worker.
36+
* `when_executed` - task is acknowledged right after it is **executed** by the worker.
37+
* `when_saved` - task is acknowledged when the result of execution is saved in the result backend.
38+
39+
This can be configured using `--ack-type` parameter. For example:
40+
41+
```bash
42+
taskiq worker --ack-type when_executed mybroker:broker
43+
```
44+
3245
### Type casts
3346

3447
One of features taskiq have is automatic type casts. For example you have a type-hinted task like this:
@@ -80,6 +93,7 @@ when you modify ignored files. To disable this functionality pass `--do-not-use-
8093
* `--no-propagate-errors` - if this parameter is enabled, exceptions won't be thrown in generator dependencies.
8194
* `--receiver` - python path to custom receiver class.
8295
* `--receiver_arg` - custom args for receiver.
96+
* `--ack-type` - Type of acknowledgement. This parameter is used to set when to acknowledge the task. Possible values are `when_received`, `when_executed`, `when_saved`. Default is `when_saved`.
8397

8498
## Scheduler
8599

docs/guide/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ We highly recommend [taskiq-aio-pika](https://pypi.org/project/taskiq-aio-pika/)
3737

3838
Now you need to create a python module with broker declaration. It's just a plain python file with the variable of your broker. For this particular example, I'm going to use the `InMemoryBroker`.
3939

40-
::: danger Important note
40+
::: caution Important note
4141
The InMemoryBroker doesn't send any data over the network,
4242
and you cannot use this broker in
4343
a real-world scenario, but it's still useful for
@@ -244,7 +244,7 @@ await my_task.kicker().with_labels(timeout=0.3).kiq()
244244

245245
:::
246246

247-
::: danger Cool alert
247+
::: caution Cool alert
248248

249249
We use [run_in_executor](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor) method to run sync functions. Timeouts will raise a TimeoutException, but
250250
synchronous function may not stop from execution. This is a constraint of python.

docs/guide/scheduling-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Now we need to start our scheduler with the `taskiq scheduler` command. Like thi
3535
taskiq scheduler module:scheduler
3636
```
3737

38-
::: danger Be careful!
38+
::: caution Be careful!
3939

4040
Please always run only one instance of the scheduler!
4141
If you run more than one scheduler at a time, please be careful since

0 commit comments

Comments
 (0)