Background job processing for Plain.
Project description
Worker
Process background jobs with a database-driven worker.
from plain.worker import Job
from plain.mail import send_mail
# Create a new job class
class WelcomeUserJob(Job):
def __init__(self, user):
self.user = user
def run(self):
send_mail(
subject="Welcome!",
message=f"Hello from Plain, {self.user}",
from_email="welcome@plainframework.com",
recipient_list=[self.user.email],
)
# Instantiate a job and send it to the worker
user = User.objects.get(pk=1)
WelcomeUserJob(user).run_in_worker()
The worker process is run separately using plain worker run.
Staff
Job history
Scheduled jobs
Monitoring
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plain_worker-0.5.2.tar.gz
(24.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plain_worker-0.5.2.tar.gz.
File metadata
- Download URL: plain_worker-0.5.2.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dce2c7fa744ea9d89a88cee3453f911498059d9802fa896f0ede0d3e44f360d4
|
|
| MD5 |
73863bdbf266b7a9b7157e5f85a1bbc8
|
|
| BLAKE2b-256 |
a8e1636e9f39591de0b22cbd45801db588dc6a5e2b031888e8add6762207749e
|
File details
Details for the file plain_worker-0.5.2-py3-none-any.whl.
File metadata
- Download URL: plain_worker-0.5.2-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57adaaacddbea254419e1e66d8983dc52f6c14dc800626a87dae9cc207d086d2
|
|
| MD5 |
0e8fee82243793ebe2bcc45ad8bda483
|
|
| BLAKE2b-256 |
45a092050978c2dc94eac2855fe0b11f696b1ee7c2719269953af9bd640032b3
|