Simple async worker
Project description
mod-ngarn
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
- flit (https://pypi.org/project/flit/)
- running PostgreSQL (
psql
should work) - python 3.7
Setup
flit install
Runtests
./runtests.sh
Publish to PyPi
flit publish
Project details
Release history Release notifications | RSS feed
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.3.tar.gz
(13.2 kB
view hashes)
Built Distribution
Close
Hashes for mod_ngarn-3.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3102af10e0759a7063be63d4032db15679ee9ebac8fcf941ed641e399249f171 |
|
MD5 | 0e37dff7f8bb2a197f2d17847aa38830 |
|
BLAKE2b-256 | b1c0de7d3a28cacec2f954a5457410d363744fd503016313bb27a358976ca2e8 |