Transactional Celery for Pyramid
A transaction-aware Celery job setup. This is integrated with the Zope transaction package, which implements a full two-phase commit protocol. While it is not designed for anything other than Pyramid, it also does not use any component of Pyramid. It’s simply not tested anywhere else.
Free software: BSD license
Documentation: https://pyramid_transactional_celery.readthedocs.org.
Features
Queues tasks into a thread-local when they are called either using delay or apply_async.
If the transaction is aborted, then the tasks will never be called.
If the transaction is committed, the tasks will go through their normal apply_async process and be queued for processing.
Limitations
Currently, the code is designed around Celery v3.1, and it is unknown whether it will work with previous versions. I’m more than happy to integrate changes that would make it work with other releases, but since I generally stay on the latest release, it isn’t a priority for my own development.
Usage
Using the library is a relatively easy thing to do. First, you’ll need to integrate Celery into your Pyramid application, for which I recommend using pyramid_celery. Once that’s done, you simply need to start creating your tasks. The big difference is for function-based tasks, you use a different decorator:
from pyramid_transactional_celery import task_tm
@task_tm
def add(x, y):
"""Add two numbers together."""
return x + y
That’s all there is to it. For class-based tasks, you simply need to subclass TransactionalTask instead of Task:
from pyramid_transactional_celery import TransactionalTask
class SampleTask(TransactionalTask):
"""A sample task that is transactional."""
def run(x, y):
return x + y
That’s it. Bob’s your uncle.
History
0.1.1 (2015-01-19)
Removed an excess creation of a CeleryDataManager that was a left-over from a previous approach. While this didn’t create a bug, it wasted memory.
0.1.0 (2015-01-19)
Initial functionality, but more testing of edge cases is needed to ensure that it works correctly in all cases, and with other versions of Celery.
First release on PyPI.
Metadata
Release files for pyramid_transactional_celery 0.1.1
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 | |
|---|---|---|---|---|
| pyramid_transactional_celery-0.1.1.tar.gz | 13.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyramid_transactional_celery-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / pyramid_transactional_celery-0.1.1.tar.gz
| Download URL | pyramid_transactional_celery-0.1.1.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11fdd71932d6784f1f7c23fb905175e2c8d94017d4a7c0a883627a1a4e747234
|
|
BLAKE2b-256 checksum How to use checksums |
1c90bb1d15b709f91771b183f6ded9cac8c5c9777487f03798ca94e4f7550697
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyramid_transactional_celery-0.1.1-py2.py3-none-any.whl
| Download URL | pyramid_transactional_celery-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6cfdb911f0f8df52253f9dd5ea58172f034ee942890906aa5ae242eae8e778ae
|
|
BLAKE2b-256 checksum How to use checksums |
3bb1ee150ddc83da5fa2040baaeb40d2d69b6292409adba8c8d7a98963884880
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyramid_transactional_celery 0.1.1
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.