Skip to main content

A lightweight background task library in Python.

Project description

QueueTeePie

QueueTeePie is a lightweight, pluggable Python library for background task processing. It includes features such as task scheduling, retry logic, task prioritization, and expiration handling.

Features

  • Task Scheduling: Schedule tasks to run at a later time.
  • Retry Logic: Retry tasks on failure.
  • Task Priority: Higher-priority tasks are executed first.
  • Task Expiration: Expired tasks are removed from the queue.
  • Background Workers: Process tasks asynchronously in the background.
  • SQLite Storage: Default persistent storage.

Installation

Clone the repository and install the dependencies with Poetry:

git clone https://github.com/yourusername/queue_tee_pie.git
cd queue_tee_pie
poetry install

Basic Usage

Enqueue a Task

from queue_tee_pie.core import TaskQueue

task_queue = TaskQueue()
task_queue.enqueue_task({'task_name': 'send_email', 'email': 'example@example.com'})

Start the Worker

from queue_tee_pie.core import TaskQueue
from queue_tee_pie.workers.worker import WorkerThread

task_queue = TaskQueue()
worker = WorkerThread(task_queue)
worker.start()

# Stop the worker gracefully
worker.stop()
worker.join()

Running the Worker Script

You can run the worker from the command line using the run_worker.py script:

python run_worker.py

License

This project is licensed under the Apache License.


This setup includes all of the essential components you need to get started with QueueTeePie as a lightweight background task processor. Let me know if you need further enhancements or specific adjustments!

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

queue_tee_pie-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

queue_tee_pie-0.1.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file queue_tee_pie-0.1.0.tar.gz.

File metadata

  • Download URL: queue_tee_pie-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.3 Darwin/23.1.0

File hashes

Hashes for queue_tee_pie-0.1.0.tar.gz
Algorithm Hash digest
SHA256 209526418ec8b01e98ba0d4a5d73df1093091edb9ca5a7cae358d6abfb882bee
MD5 7d49371029a61414bb6375ca7c1e4a0e
BLAKE2b-256 d1d09dca902c4a4750d02ab2ec5e5f459c0c32cec71ef9aaa480dc8ebd6307c1

See more details on using hashes here.

File details

Details for the file queue_tee_pie-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: queue_tee_pie-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.3 Darwin/23.1.0

File hashes

Hashes for queue_tee_pie-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 386525ba6bfc7e7ad9db800e9cfd0a8b82ee9ce62e72d69a1250e48081366c55
MD5 17b6a03dc96b49b8b8485229ed508a51
BLAKE2b-256 88f1ad3ac48443c461fc46c3a03ccb3519fab9a8ce4b60f47c22a9d61670c8a8

See more details on using hashes here.

Supported by

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