Skip to main content

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

Downloads PyPI version Repo Size PyPI - License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

task_queue_checker-0.0.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

task_queue_checker-0.0.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

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

Hashes for task_queue_checker-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6ab323855d8aee724321d4f00ac9ec2e0d2184b3646a3c7f50467a55bdb4abaa
MD5 b3ca036e7196f77e5435811e4ec4fc0f
BLAKE2b-256 24fe989c3484234c84030bb99a71762157c2c295539b8368026e7b34059007f7

See more details on using hashes here.

File details

Details for the file task_queue_checker-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for task_queue_checker-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dd99efc243af676f3f3f44085f5e66790a9a984a6fd375696298c12246bbadee
MD5 93b65c0d469f49fdb982e72491289f0c
BLAKE2b-256 b64ed8d344c0425ef2650ae01d88eb69b962333d1d5683041008402529a05543

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page