Skip to main content

Rethinkdb job queues

Project description

TQueues

TQueues (reThinkdb Queues) is a simple python3.5+ library for queueing jobs and processing them in workers using rethinkdb.

Features

  • Accepts coroutines as jobs

  • Distributed

  • Handles everything in a rethinkdb database object that can be reused at the worker

  • Exposes changes via websockets

  • Uses rethinkdb streaming “changes” method, wich is pretty efficient

  • Uses asyncio, implements an async context manager for jobs and async iterator for the workers

                        +--> Worker
                        |
Rethindb --> Dispatcher ---> Worker
                        |
                        +--> Worker

Usage

TQueues provides two entry points, tqueues_dispatcher and tqueues_worker.

TQueues dispatcher must be accesible from all workers, and you need to start one worker per parallel task you need. They may be distributed (as long as they can reach the dispatcher)

TQueues worker

Usage:
    tqueues_worker -h | --help
    tqueues_worker --version
    tqueues_worker --endpoint_url <endpoint_url>
    tqueues_worker --queue <queue>

Options:
    -h --help                        Show this screen
    -v --version                     Show version
    --endpoint_url <ENDPOINT_URL>    TQueues dispatcher endpoint
    --queue        <QUEUE>           Endpoint queue to listen on

Examples:
    tqueues_worker --endpoint_url http://127.0.0.1:800/ --queue testqueue

TQueues job dispatcher

Usage:
    tqueues_dispatcher --db "db" --host "127.0.0.1" --port 28015
    tqueues_dispatcher --db "db" --host "127.0.0.1"
    tqueues_dispatcher --db "db" --port 28015
    tqueues_dispatcher --db "db" --user 'user'
    tqueues_dispatcher --db "db" --password 'password'
    tqueues_dispatcher -h | --help
    tqueues_dispatcher --version

Options:
    --host "127.0.0.1"                          Rethinkdb host
    --db "db"                                   Rethinkdb databaes
    --port 28015                                Rethinkdb port
    --user 'user'                               Rethinkdb user
    --password 'password'                       Rethinkdb password
    --allowed_domains 'foo.com,bar.com'         Allowed domains
    --loglevel (DEBUG|INFO)                     Loglevel
    -h   --help                                 Show this screen
    --version                                   Show version

Examples:
    tqueues_dispatcher --host localhost --db foo --port 28015 --user foo --password bar --loglevel INFO --allowed_domains 'foo.com,bar.com'

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

tqueues-0.1.7.tar.gz (15.4 kB view details)

Uploaded Source

File details

Details for the file tqueues-0.1.7.tar.gz.

File metadata

  • Download URL: tqueues-0.1.7.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tqueues-0.1.7.tar.gz
Algorithm Hash digest
SHA256 e01aa651686adbc4de8c0f45bb73e7ece339b234c08594d1e34832688071639c
MD5 f916822ac706fbd8a09d9473426a8ded
BLAKE2b-256 ea2e6c32f4d9e927ddd607b0648f67e76cc276b3e16003811592a38cca9a1fe5

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