Skip to main content

Simple async worker

Project description

mod-ngarn

CircleCI PyPI version

Usage

Usage: mod-ngarn [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  create-table     Create mod-ngarn queue table
  delete-job       Delete executed task
  run              Run mod-ngarn job
  wait-for-notify  Wait and listening for NOTIFY

Installation

pip install mod-ngarn

Run modngarn

Usage: mod-ngarn run [OPTIONS]

  Run mod-ngarn job

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --limit INTEGER     Limit jobs (Default: 300)
  --max-delay FLOAT   Max delay for failed jobs (seconds) (Default: None)
  --help              Show this message and exit.

Create modngarn job queue table

Usage: mod-ngarn create-table [OPTIONS]

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --help              Show this message and exit.

Wait for notify

Usage: mod-ngarn wait-for-notify [OPTIONS]

  Wait and listening for NOTIFY

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --help              Show this message and exit.

Delete executed job

Usage: mod-ngarn delete-job [OPTIONS]

  Delete executed task

Options:
  --queue-table TEXT  Queue table name (Default: os.getenv("DBTABLE",
                      "public.modngarn_job"))
  --help              Show this message and exit.

Example run script

#!/bin/bash
set -u

while true
do
    mod-ngarn run $*
    timeout 5 mod-ngarn wait-for-notify
done

Dev

Required

Setup

flit install

Runtests

./runtests.sh

Publish to PyPi

flit publish

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

mod_ngarn-3.5.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

mod_ngarn-3.5-py2.py3-none-any.whl (24.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mod_ngarn-3.5.tar.gz.

File metadata

  • Download URL: mod_ngarn-3.5.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for mod_ngarn-3.5.tar.gz
Algorithm Hash digest
SHA256 568535d425f3e03bd996a76bcfc4b7a0b0624439de692b9ac22d694e1ea45e8e
MD5 33e05ae1d1dcc94c4851ada65caf3ca0
BLAKE2b-256 70caf5a5497e48ebd9fc821dc5645cd469e1b9ca77af82e194f79ec91a98c75f

See more details on using hashes here.

File details

Details for the file mod_ngarn-3.5-py2.py3-none-any.whl.

File metadata

  • Download URL: mod_ngarn-3.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for mod_ngarn-3.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1b59bfa5aafc574a9f1c1ae7219b96460657377e539d04ce4b83338d11ad276a
MD5 fb84164877b405e97d9c16bea6007ddf
BLAKE2b-256 ced39073fc8e224a3ff358380a582ff00aa7e9e9f0dd98454dccb69e885e2e54

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