Skip to content

Commit

Permalink
Merge branch 'release/0.10.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Nov 30, 2023
2 parents 9a6e49f + cb72734 commit 6441c59
Show file tree
Hide file tree
Showing 32 changed files with 2,123 additions and 1,964 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
strategy:
matrix:
py_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
pydantic_ver: ["<2", ">=2,<3"]
os: [ubuntu-latest, windows-latest]
runs-on: "${{ matrix.os }}"
steps:
Expand All @@ -50,6 +51,8 @@ jobs:
cache: "poetry"
- name: Install deps
run: poetry install --all-extras
- name: Setup pydantic version
run: poetry run pip install "pydantic ${{ matrix.pydantic_ver }}"
- name: Run pytest check
run: poetry run pytest -vv -n auto --cov="taskiq" .
- name: Generate report
Expand Down
2 changes: 1 addition & 1 deletion docs/available-components/brokers.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ It's suitable for small projects with only ONE worker process, because of the ZM
It publishes messages on the local port. All worker processes are reading messages from this port.
If you run many worker processes, all tasks will be executed `N` times, where `N` is the total number of worker processes.

::: danger Be careful!
::: caution Be careful!
If you choose this type of broker, please run taskiq with `-w 1` parameter,
otherwise you may encounter undefined behavior.
:::
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/extending/schedule_source.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Coroutine, List
from typing import List

from taskiq import ScheduledTask, ScheduleSource

Expand Down
2 changes: 1 addition & 1 deletion docs/extending-taskiq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ All abstract classes can be found in `taskiq.abc` package.

- [Brokers](./broker.md)
- [Middlewares](./middleware.md)
- [Result backends](./resutl-backend.md)
- [Result backends](./result-backend.md)
- [CLI](./cli.md)
- [Schedule sources](./schedule-sources.md)
2 changes: 1 addition & 1 deletion docs/extending-taskiq/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 2

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ It's a good practice to skip fetching logs from the storage unless `with_logs=Tr
:::


::: danger Important note!
::: caution Important note!
`with_logs` param is now deprecated. It will be removed in future releases.
:::
2 changes: 1 addition & 1 deletion docs/guide/architecture-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you use dark theme and cannot see words on diagram,
try switching to light theme and back to dark.
:::

```sequence
```mermaid
rect rgb(191, 223, 255)
note right of Your code: Client side.
Your code ->> Kicker: assemble message
Expand Down
14 changes: 14 additions & 0 deletions docs/guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ We have two options for this:
It's a name of files to import. By default is searches for all `tasks.py` files.
- `--fs-discover` or `-fsd`. This option enables search of task files in current directory recursively, using the given pattern.

### Acknowledgements

The taskiq supports three types of acknowledgements:
* `when_received` - task is acknowledged when it is **received** by the worker.
* `when_executed` - task is acknowledged right after it is **executed** by the worker.
* `when_saved` - task is acknowledged when the result of execution is saved in the result backend.

This can be configured using `--ack-type` parameter. For example:

```bash
taskiq worker --ack-type when_executed mybroker:broker
```

### Type casts

One of features taskiq have is automatic type casts. For example you have a type-hinted task like this:
Expand Down Expand Up @@ -80,6 +93,7 @@ when you modify ignored files. To disable this functionality pass `--do-not-use-
* `--no-propagate-errors` - if this parameter is enabled, exceptions won't be thrown in generator dependencies.
* `--receiver` - python path to custom receiver class.
* `--receiver_arg` - custom args for receiver.
* `--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`.

## Scheduler

Expand Down
4 changes: 2 additions & 2 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ We highly recommend [taskiq-aio-pika](https://pypi.org/project/taskiq-aio-pika/)

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`.

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

:::

::: danger Cool alert
::: caution Cool alert

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
synchronous function may not stop from execution. This is a constraint of python.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/scheduling-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Now we need to start our scheduler with the `taskiq scheduler` command. Like thi
taskiq scheduler module:scheduler
```

::: danger Be careful!
::: caution Be careful!

Please always run only one instance of the scheduler!
If you run more than one scheduler at a time, please be careful since
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"@vuepress/client": "2.0.0-beta.67",
"vue": "^3.3.4",
"vuepress": "2.0.0-beta.67",
"vuepress-plugin-search-pro": "2.0.0-beta.237",
"vuepress-theme-hope": "2.0.0-beta.237"
"@vuepress/client": "2.0.0-rc.0",
"mermaid": "^10.6.1",
"vue": "^3.3.9",
"vuepress": "2.0.0-rc.0",
"vuepress-plugin-search-pro": "2.0.0-rc.1",
"vuepress-theme-hope": "2.0.0-rc.1"
}
}
Loading

0 comments on commit 6441c59

Please sign in to comment.