Tool designed to simplify the management and monitoring of task queues in Python environments
Project description
task-queue-checker
Tool designed to simplify the management and monitoring of task queues in Python environments
Installing
pip install task-queue-checker
Tutorial
import time
import random
from task_queue_checker.storage import PersistQueueSQLite
from task_queue_checker.types import Task
from task_queue_checker import TaskQueueChecker
storage = PersistQueueSQLite()
# add tasks to queue
storage.add([1, 2, 3, "Hola Mundo"])
storage.add({"name": "Raùl", "last_name": "Cobiellas"})
storage.add("Task # 3")
storage.add("Task # 4")
def consumer(task: Task):
print(task.data) # task content
number = random.randint(1, 3)
if number == 1:
print(f"task {task.id} done")
task.done()
elif number == 2:
print(f"task {task.id} canceled")
task.cancel()
elif number == 3:
print(f"task {task.id} put last")
task.put_last()
monitor = TaskQueueChecker(consumer=consumer, task_storage=storage)
# run monitor in background
monitor.start()
# this code simulates the execution of your main program
while True:
try:
time.sleep(10)
except KeyboardInterrupt:
break
TODO
- create PersistQueueMySql
Release Notes (0.0.3)
- update file configuration
- add PersistQueuePostgres
- fix TaskBase and Task
- fix name from Perstist to Persist of storages
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file task_queue_checker-0.0.3.tar.gz.
File metadata
- Download URL: task_queue_checker-0.0.3.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ab323855d8aee724321d4f00ac9ec2e0d2184b3646a3c7f50467a55bdb4abaa
|
|
| MD5 |
b3ca036e7196f77e5435811e4ec4fc0f
|
|
| BLAKE2b-256 |
24fe989c3484234c84030bb99a71762157c2c295539b8368026e7b34059007f7
|
File details
Details for the file task_queue_checker-0.0.3-py3-none-any.whl.
File metadata
- Download URL: task_queue_checker-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd99efc243af676f3f3f44085f5e66790a9a984a6fd375696298c12246bbadee
|
|
| MD5 |
93b65c0d469f49fdb982e72491289f0c
|
|
| BLAKE2b-256 |
b64ed8d344c0425ef2650ae01d88eb69b962333d1d5683041008402529a05543
|