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.18.0.tar.gz (18.7 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.18.0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plain_worker-0.18.0.tar.gz
Algorithm Hash digest
SHA256 71ad08fb008bb4b32f384fcfdd08b879bea447067d2190973ef307a88e9e03a7
MD5 d6d1c7f7a03253721e3b809a406def19
BLAKE2b-256 5ba303af00b68725af938464543d7b81b441b09f093524fde3335c064410e4cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plain_worker-0.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af0038ba3a996d0d680c1f7a53cdb86859b202efb6e78e3cc2a5d9786357d872
MD5 91c43872f8fb408618272c6e28529a84
BLAKE2b-256 75c9938a89ca76ec6b2851ea3eb98df9b94b738c283b782dda1234694c4d96bf

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