django-uwsgi-spooler
A polyvalent Task model to get the most out of uWSGI’s spooler with minimal effort.
Install
Install django-threadlocals if you want automatic provisioning of Task.user and Task.creation_ip.
This app works without uwsgi installed (ie. runserver), but you can test your wsgi app with a command like:
uwsgi --env DEBUG=1 --spooler=/tmp/spool --spooler-processes 16 --http-socket=0.0.0.0:8000 --plugin=python --module=mrs.wsgi:application --honour-stdin
Add django_uwsgi_spooler to INSTALLED_APPS and execute migrations with the ./manage.py migrate command.
django_uwsgi_spooler.models will set uwsgi.spooler so you don’t have any extra setup to do to enjoy uWSGI spooler, besides have it enabled if you want tasks to actually run in the background.
If you have CRUDLFA+ installed, it will register a CRUD for task, which will gain a lot of features as we move forward to 1.0 release as you can imagine: towards full control of the spooler as permited by uWSGI’s API.
Usage
Your callback is just a function that takes a task argument:
def yourcallback(task):
# do stuff ...
You can start a task as such:
Task(callback_name='yourmodule.yourcallback').spool()
See a more elaborated example in django_uwsgi_spooler/example.py
Metadata
Release files for django-uwsgi-spooler 0.0.0
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 | Actions |
|---|---|---|---|---|
| django-uwsgi-spooler-0.0.0.tar.gz | 2.1 kB | Without provenance | Details for django-uwsgi-spooler-0.0.0.tar.gz |
Release files / django-uwsgi-spooler-0.0.0.tar.gz
| Download URL | django-uwsgi-spooler-0.0.0.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eecb7533027dcb963cc7cca3566d9bc33218e431a755c05a9c89d88bd3d94152
|
|
BLAKE2b-256 checksum How to use checksums |
7be3cb959a3e8ee0018ac0ae0981ba08f8516b1e76ba36a0af77d23b21566104
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for django-uwsgi-spooler 0.0.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.