-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Features: * Accept --concurrency N option and spawn N workers * Wait for child workers ready before propagate msg * Ensure worker exit early with message when app path invalid * Make parallel requests when checking for ready workers Dev features & tech debts: * Ensure run some tests asynchronously * Remove unnecessary GithubAction workflow * Add docstrings to some modules, classes and functions * Cleanup using pylint and black (Will add pylint to CI in the future) * Allow specify test pattern on ./test.sh Notes: Currently we see this warning when running the tests: ``` Task was destroyed but it is pending! task: <Task pending name='Task-5' coro=<Connection.disconnect()\ done, defined at /home/in-gote/workspace/aiotaskq/.venv/lib/\ python3.10/site-packages/aioredis/connection.py:794> wait_for=<\ Future pending cb=[Task.task_wakeup()]>> ``` We should fix it in the future. Also, currently because in some tests (e.g. `test_integration.test_sync_and_async_parity__simple_app`) we're starting the worker in a sub-process, `coverage` doesn't count anything in worker.py. I tried following this guide: https:// coverage.readthedocs.io/en/6.4.4/api_module.html#coverage.process _startup, but I couldn't get it to work. Maybe I missed something. We also need to fix this in the future. We should consider either: 1. Start the worker using `multiprocessing` instead of `subprocess` 2. Somehow follow the guide correctly
- Loading branch information
1 parent
84c18b7
commit 136ae39
Showing
19 changed files
with
506 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
source = src/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
"""Module to define and store all constants used across the library.""" | ||
|
||
REDIS_URL = "redis://127.0.0.1:6379" | ||
TASKS_CHANNEL = "channel:tasks" | ||
RESULTS_CHANNEL_TEMPLATE = "channel:results:{task_id}" | ||
|
||
# REDIS_URL = "redis://127.0.0.1:6379" | ||
# TASKS_CHANNEL = "channel:tasks" | ||
# RESULTS_CHANNEL_TEMPLATE = "channel:results:{task_id}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
class WorkerNotReady(Exception): | ||
"""Attempt to send task to worker but no worker is subscribing to tasks channel.""" | ||
""" | ||
Define all exceptions that are possibly raised by the package. | ||
Any raised thrown must be defined here. | ||
""" | ||
|
||
|
||
class ModuleInvalidForTask(Exception): | ||
"""Attempt to convert to task a function in an invalid module.""" |
Oops, something went wrong.