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.email 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.20.0.tar.gz (18.6 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.20.0-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plain_worker-0.20.0.tar.gz
Algorithm Hash digest
SHA256 07e2738dadd022d640e7bc5a7eac83aab92d718d10e1e307a26528c62d211a48
MD5 17e4a333626474cc57e0e099df755ed4
BLAKE2b-256 2d2d19bb8ae6d8aeaeb0cacf5eb46d8a2a1bba74cf2adfd1394e74595a3ea679

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plain_worker-0.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 954ef2100588495c492e7110e3397499bcdc8488a627ffdcbc78b9f70b46ca1a
MD5 94a39f51a554284b8775a18bcc181365
BLAKE2b-256 77ca9b351441711068812a769ad041be725e1962c5b321f386861843bdbbcdc4

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