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.10.0.tar.gz (17.2 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.10.0-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plain_worker-0.10.0.tar.gz
Algorithm Hash digest
SHA256 8b6bd2fe2233de22ce5271e72b6c22c9b83f8d14c33f89f75de31d45093e7607
MD5 7c0379ff47d4828d80844cd76b82ee2a
BLAKE2b-256 5efe96cb5e96ee991a1ab9672a573ea53472790714656c9e3065297ff5f5627c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plain_worker-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eadce03f98b8330569824b6cf86db9fc26d63fd1089f1ddac59c17e899474588
MD5 8a302622490fbed3f3f164a6ab1f3f20
BLAKE2b-256 def5025cb88e4fdd8018cb40134dd47b16d48de9317a1bcb5c71b297ceefb77f

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