Skip to content

Commit

Permalink
Fixed mypy job (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius authored Oct 10, 2023
1 parent cf87480 commit 0705f73
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
- name: Install deps
run: poetry install
- name: Release package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
cache: "poetry"
- name: Install deps
run: poetry install
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/guide/dynamic-brokers.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Taskiq allows you to set up broker instances throughout your application and reg

To define tasks and assign them to a broker, use `register_task` method.

@[code python](../examples/dynamics/broker.py)
@[code python](../examples/dynamics/dyn_broker.py)

In this example, the task is defined using a lambda within the `main` function. As the lambda is not visible outside of the `main` function scope, the task is not executable by `taskiq worker` command.

Expand All @@ -24,10 +24,10 @@ To overcome this issue, you can:

Here's an example of a dynamic worker task creation:

@[code python](../examples/dynamics/receiver.py)
@[code python](../examples/dynamics/dyn_receiver.py)

In this example, a named dynamic lambda task is created and registered in a broker, similar to the previous example. The difference is the creation of a new receiver coroutine for the worker task. It will listen to the new messages and execute them. The worker task will be executed in the current event loop. After exiting the scope, the worker task will get cancelled. For illustration purposes it is cancelled explicitly.

It's possible to run a scheduler in the current event loop as well:

@[code python](../examples/dynamics/scheduler.py)
@[code python](../examples/dynamics/dyn_scheduler.py)
12 changes: 1 addition & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0705f73

Please sign in to comment.