Skip to content

Commit 160dd38

Browse files
committed
Merge branch 'release/0.2.2'
2 parents 0f4d746 + 1bb0f95 commit 160dd38

File tree

7 files changed

+26
-19
lines changed

7 files changed

+26
-19
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ jobs:
5656
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.9'
5757
with:
5858
token: ${{ secrets.CODECOV_TOKEN }}
59-
fail_ci_if_error: true
59+
fail_ci_if_error: false
6060
verbose: true

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Pavel Kirilin
3+
Copyright (c) 2022-2023 Pavel Kirilin
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ head:
1616
- name: "google-site-verification"
1717
content: "hQCR5w2tmeuOvYIYXsOYU3u4kLNwT86lnqltANYlRQ0"
1818
features:
19+
- title: Production ready
20+
details: Taskiq has proven that it can run in heavy production systems with high load.
1921
- title: Fully asynchronous
2022
details: Taskiq can run both sync and async functions. You don't have to worry about it.
2123
- title: Easily extensible
2224
details: Taskiq has a lot of replaceable components. It's super easy to implement
2325
your own broker or middleware.
2426
- title: Strongly typed
2527
details: Taskiq provides correct autocompletion for most of its functionality.
26-
- title: Simple
27-
details: We tried to make the interface to be as simple as possible. And we are proud of it.
28-
footer: MIT Licensed | Copyright© 2022
28+
footer: MIT Licensed | Copyright© 2022-2023
2929
---
3030

3131
## Installation

docs/guide/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,22 @@ replaceable parts, such as brokers, result backends, and middlewares.
1818
## Why not use existing libraries?
1919

2020
We couldn't find a solution like Celery or Dramatiq that can run async code and send tasks asynchronously.
21-
It was the main reason we created this project. It's still in the early stages of development,
22-
so it's not a production-ready solution yet. We use it at work, but still, you may encounter bugs.
23-
If your project requires mature solutions, please use Dramatiq or Celery instead.
21+
It was the main reason we created this project.
2422

25-
Also, this project is not for you if you have a fully synchronous project.
23+
You might have seen projects built on top of asyncio that solve similar problem, but here's a comparasion table of taskiq and other projects.
24+
25+
| Feature name | Taskiq | Arq | AioTasks |
26+
| --------------------------: | :----: | :---: | :------: |
27+
| Actively maintained ||||
28+
| Multiple broker backends ||||
29+
| Multiple result backends ||||
30+
| Have a rich documentation ||||
31+
| Startup & Shutdown events ||||
32+
| Have ability to abort tasks ||||
33+
| Custom serializers ||||
34+
| Dependency injection ||||
35+
| Task pipelines ||||
36+
| Task schedules ||||
37+
| Global middlewares ||||
38+
39+
If you have a fully synchronous project, consider using celery or dramatiq instead.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "taskiq"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
description = "Distributed task queue with full async support"
55
authors = ["Pavel Kirilin <[email protected]>"]
66
maintainers = ["Pavel Kirilin <[email protected]>"]

taskiq/cli/worker/process_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def handle(
7575
daemon=True,
7676
)
7777
new_process.start()
78+
logger.info(f"Process {new_process.name} restarted with pid {new_process.pid}")
7879
workers[self.worker_num] = new_process
7980

8081

@@ -163,12 +164,12 @@ def prepare_workers(self) -> None:
163164
name=f"worker-{process}",
164165
daemon=True,
165166
)
167+
work_proc.start()
166168
logger.info(
167169
"Started process worker-%d with pid %s ",
168170
process,
169171
work_proc.pid,
170172
)
171-
work_proc.start()
172173
self.workers.append(work_proc)
173174

174175
def start(self) -> None: # noqa: C901, WPS213

taskiq/cli/worker/run.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import asyncio
22
import logging
33
import signal
4-
import sys
5-
from logging.handlers import QueueHandler, QueueListener
6-
from multiprocessing import Queue
74
from typing import Any
85

96
from watchdog.observers import Observer
@@ -120,15 +117,11 @@ def run_worker(args: WorkerArgs) -> None: # noqa: WPS213
120117
121118
:param args: CLI arguments.
122119
"""
123-
logging_queue = Queue(-1) # type: ignore
124-
listener = QueueListener(logging_queue, logging.StreamHandler(sys.stdout))
125120
logging.basicConfig(
126121
level=logging.getLevelName(args.log_level),
127122
format="[%(asctime)s][%(name)s][%(levelname)-7s][%(processName)s] %(message)s",
128-
handlers=[QueueHandler(logging_queue)],
129123
)
130124
logging.getLogger("watchdog.observers.inotify_buffer").setLevel(level=logging.INFO)
131-
listener.start()
132125
logger.info("Starting %s worker processes.", args.workers)
133126

134127
observer = Observer()
@@ -149,4 +142,3 @@ def run_worker(args: WorkerArgs) -> None: # noqa: WPS213
149142
logger.info("Stopping watching files.")
150143
observer.stop()
151144
logger.info("Stopping logging thread.")
152-
listener.stop()

0 commit comments

Comments
 (0)