Skip to main content

The Mule

tests

TheMule is an async task runner for python.

About

The purpose of this library is to run long running, heavy tasks in the background using cloud-native solutions. It's modular design allows you to use different backends for individual background tasks.

TheMule vs. Celery

TheMule is not intended to replace Celery. They play well together: Celery used to run small and fast tasks, while TheMule is used to run heavy and slow task.

Design principal TheMule Celery
Worker lifecycle One docker container per task Long living worker process
Application codebase Main application and worker can run from different docker images, but the syntax is simpler when they share the codebase Main application and worker share codebase
Task assignment Tasks can run on different backends; Tasks assignment is done in backend Tasks can be assigned to workers with routing
Task queueing Backend-specific External queueing service (Redis, RabbitMQ)

Available Backends

TheMule comes with pre-made backends and you can write your own.

AWS Batch

Installation: pip install themule[aws_batch]

Class path: themule.backends.AwsBatchBackend

Configuration:

Job parameter Env variable Required Default Description
aws_batch_queue_name THEMULE_AWS_BATCH_QUEUE_NAME Yes - The name of AWS Batch queue
aws_batch_job_definition THEMULE_AWS_BATCH_JOB_DEFINITION Yes - The name of AWS Batch job definition

Local Docker

Installation: pip install themule[docker]

Class path: themule.backends.LocalDockerBackend

Configuration:

Job parameter Env variable Required Default Description
docker_image THEMULE_DOCKER_IMAGE Yes - The name of the Docker image
docker_entrypoint THEMULE_DOCKER_ENTRYPOINT No None Override of the container's entrypoint
docker_pass_environment THEMULE_DOCKER_PASS_ENVIRONMENT No True Passes application's env to worker container if true
docker_environment THEMULE_DOCKER_ENVIRONMENT No None Additional container environment variables
docker_auto_remove THEMULE_DOCKER_AUTO_REMOVE No True Removes the container after worker exit if true
run_options THEMULE_DOCKER_RUN_OPTIONS No - Allows to set docker run options

Metadata

Release files for themule 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for themule 0.3.0
File Size Uploaded Provenance
themule-0.3.0.tar.gz 9.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for themule 0.3.0
File Interpreter ABI Platform
themule-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / themule-0.3.0.tar.gz

Download URL themule-0.3.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4b3e29272181bebab03273e4225614d84c915ab332661c895702877160b1fac0
BLAKE2b-256 checksum
How to use checksums
5e0c48cd70543dc25b28e7249f6f1f92a0a874b9c35fdcda1b97571357b8e78b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.18

Release files / themule-0.3.0-py3-none-any.whl

Download URL themule-0.3.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cba0625cf9e4d04b1d107c0ee0496a3eda9120962259ac0acca4de439e56764
BLAKE2b-256 checksum
How to use checksums
1756c00a8da9eb0bc9f77a72bc07b89201460191b104c4c3486ad86a4f4f6b10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.18

Security for themule 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page