This release is a pre-release and may not be stable for production use.
Celery AsyncIO Pool
Free software: GNU Affero General Public License v3+
Getting Started
Installation
Using Poetry (preferred)
poetry add celery-aio-pool
Using pip & PyPI.org
pip install celery-aio-pool
Using pip & GitHub
pip install git+https://github.com/the-wondersmith/celery-aio-pool.git
Using pip & A Local Copy Of The Repo
git clone https://github.com/the-wondersmith/celery-aio-pool.git
cd celery-aio-pool
pip install -e "$(pwd)"
Configure Celery
Option 1: Using Celery's Out-Of-Tree Worker Pool (preferred)
Configuring Custom Worker Pool
Celery now supports the configuration of out-of-tree worker pool classes, allowing you to configure custom pools like celery-aio-pool directly:
-
Set the environment variable
CELERY_CUSTOM_WORKER_POOLto the name of your desired worker pool implementation.- NOTE: The value must be formatted as
package:class -
export CELERY_CUSTOM_WORKER_POOL='celery_aio_pool.pool:AsyncIOPool'
- NOTE: The value must be formatted as
-
Start Celery with
--pool=customto use the configured pool:-
celery worker --pool=custom --loglevel=INFO --logfile="$(pwd)/worker.log"
-
To verify the pool configuration, use celery inspect stats:
celery --app=your_celery_project inspect stats
-> celery@freenas: OK
{
...
"pool": {
...
"implementation": "celery_aio_pool.pool:AsyncIOPool",
...
Option 2: Monkey-patching Celery (non-preferred) for older versions of Celery (<5.3)
Using celery-aio-pool's Provided Patcher
- Import
celery_aio_poolin the same module where your Celery "app" is defined - Ensure that the
patch_celery_tracerutility is called before any other Celery code is called
"""My super awesome Celery app."""
# ...
from celery import Celery
# add the following import
import celery_aio_pool as aio_pool
# ensure the patcher is called *before*
# your Celery app is defined
assert aio_pool.patch_celery_tracer() is True
app = Celery(
"my-super-awesome-celery-app",
broker="amqp://guest@localhost//",
# add the following keyword argument
worker_pool=aio_pool.pool.AsyncIOPool,
)
Developing / Testing / Contributing
NOTE: Our preferred packaging and dependency manager is Poetry. Installation instructions can be found here.
Developing
Clone the repo and install the dependencies
$ git clone https://github.com/the-wondersmith/celery-aio-pool.git \
&& cd celery-aio-pool \
&& poetry install --sync
Alternatively, if you prefer not to use Poetry, celery-aio-pool is fully PEP-517
compliant and can be installed directly by any PEP-517-compliant package manager.
$ cd celery-aio-pool \
&& pip install -e "$(pwd)"
TODO: Coming Soon™
Testing
To run the test suite:
$ poetry run pytest tests/
Contributing
TODO: Coming Soon™
Metadata
Release files for celery-aio-pool 0.1.0rc8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| celery_aio_pool-0.1.0rc8.tar.gz | 24.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| celery_aio_pool-0.1.0rc8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.8 kB
Release files / celery_aio_pool-0.1.0rc8.tar.gz
| Download URL | celery_aio_pool-0.1.0rc8.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47ffe9307a8be94eb39cc1c6607f49b18db2c797623fb6ea0825835dd50652f2
|
|
BLAKE2b-256 checksum How to use checksums |
24502d0962983fe1b21a4969454f804c12b5d10ad5ae335342b8520eed1d8899
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.2 Darwin/23.6.0
|
Release files / celery_aio_pool-0.1.0rc8-py3-none-any.whl
| Download URL | celery_aio_pool-0.1.0rc8-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a7631ea2759e6c8ae769fe668a3af34299a6ee730dabe57e36e66d66611b14a
|
|
BLAKE2b-256 checksum How to use checksums |
3fed27407bd7aa280c9d6a3a33d541277bc35ad9a97d2eabac3c67e148da29fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.2 Darwin/23.6.0
|
Security for celery-aio-pool 0.1.0rc8
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.