Skip to main content

No project description provided

Project description

Dramatiq ApScheduler

Allows simple command line usage of ApScheduler to add tasks directly to Dramatiq. It is designed to support multiple concurrent scheduler process such as in the case of Elastic Beanstalk.

You can run multiple process and each one will check if it's the leader before executing any tasks.

Requirements

The application uses rabbitmq and redis.

By default both rabbitmq and redis will just use localhost but on most systems you are running these services on another server. You can configure both redis and rabbitmq by providing the connection urls as options redis and rabbitmq or environment variables SCHEDULE_REDIS and SCHEDULE_RABBITMQ.

Config

Below is a minimal example of the config. To add more tasks just simply edit the jobs config option.

jobs:
  trigger_feed_run_every_10_minutes:
    func: run_feeds
    crontab: "*/10 * * * *"
  trigger_test_task:
    func: test_task
    crontab: "*/1 * * * *"
    queue_name: test

Triggers

Currently only one trigger is supported crontab. We recommend you use https://crontab.guru/ to validate your expressions.

Usage

Just run the task to start the process. You can also add the --debug flag to get extra logging.

Usage: dramatiq_apscheduler [OPTIONS] CONFIGFILE

Options:
  --debug           Enables debug logging
  --rabbitmq TEXT   rabbitmq connection url: amqp://127.0.0.1:5672/
  --redis TEXT      redis connection url: redis://localhost/
  --sticky INTEGER  How long a process should stay the leader
  --help            Show this message and exit.

You can run with the demo config:

dramatiq_apscheduler config.yaml

Development

The easiest way to develop this application is in a venv. You can see more details in the click documentation but if your venv is setup just run the below command.

 pip install --editable .

Dockerfile

A docker image is also provided which allows you to easily run the application anywhere.

docker pull scollins/dramatiq-apscheduler
docker run scollins/dramatiq-apscheduler

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

dramatiq-apscheduler-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

dramatiq_apscheduler-0.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file dramatiq-apscheduler-0.0.1.tar.gz.

File metadata

  • Download URL: dramatiq-apscheduler-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for dramatiq-apscheduler-0.0.1.tar.gz
Algorithm Hash digest
SHA256 72b1802ff83cff05ef6448bdd984b4fca0d399bae0fdfc90295a757eef7bb618
MD5 914cadd8018911f1c6ce313bf52a8902
BLAKE2b-256 32af860ab5685499a638b2cfb2e1868cce7f2704b02bd22810469ab1dc803c72

See more details on using hashes here.

File details

Details for the file dramatiq_apscheduler-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dramatiq_apscheduler-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for dramatiq_apscheduler-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6d8b497f3920014d26f6b7497e6752b80e193d540bab04df6703e49e8e171c0
MD5 b79d81c552eb83222e1b2211e57ce6b6
BLAKE2b-256 2a4a9ae48a84e37bc0d292c0becf940d7e5ede9377a227ce3f3cc955597250f7

See more details on using hashes here.

Supported by

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