Skip to main content

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.

Admin

Job history

Scheduled jobs

Monitoring

Project details


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.7.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plain_worker-0.7.1-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file plain_worker-0.7.1.tar.gz.

File metadata

  • Download URL: plain_worker-0.7.1.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.30

File hashes

Hashes for plain_worker-0.7.1.tar.gz
Algorithm Hash digest
SHA256 0fc4a3d24d8258d3235a9c7a3873fa1f688eb7043aa0b2b2c22a9f4bcf0acf97
MD5 4609b4924a2bcc05fc5496ee835a1bad
BLAKE2b-256 26a1e0f04d94e07bbfa186418cbf43626a5a4a9ba27b46b42be7e4aff0fd58ca

See more details on using hashes here.

File details

Details for the file plain_worker-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for plain_worker-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fb6a226cc4857411b20f5039877dfb39ddae3a636af5526c10664ece0c125c7
MD5 c0ca902b948ed4486c899a1399773825
BLAKE2b-256 3f69935d680603dd8af67bf6e28f11491ab38e21f80bc85a483902fab598de29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page