Skip to content

ryansb/disq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9d46835 · Sep 3, 2015

History

51 Commits
Sep 2, 2015
Apr 29, 2015
Sep 3, 2015
Apr 30, 2015
Sep 3, 2015
Apr 28, 2015
Sep 3, 2015
Apr 28, 2015
May 18, 2015
Apr 29, 2015
Apr 28, 2015
Apr 30, 2015
Sep 2, 2015

Repository files navigation

disq

A disque Python client.

Build Status

Under the hood, this used redis-py's HiRedis implementation and switches out Redis commands with the disque ones.

Usage

from disq import Disque

c = Disque() # connects to localhost:7711 by default
c.addjob('queuename', 'body') # takes all ADDJOB arguments
# b'DI... job id ...SQ'
c.getjob('queuename')
# [[b'queue', b'DI3971f14a850d9e5b3ca5c881e3dd1ba2a34277b505a0SQ', b'body']]

Status

This library is ready to use with single or multi-node clusters. All commands are implemented except for QSTAT and SCAN, which don't exist in the disque server yet.

Features

Connection Balancing

As specified in the disque README, disq directs read and ack operations (GETJOB, ACKJOB, FASTACK) to whichever member of the cluster it has received the most jobs from in the last N seconds.

To change the length of the job count window, use the job_origin_ttl_secs argument when creating the disque client.

License

This code is released under the ASL2.0, see the LICENSE file for details.

Thanks

Enormous thanks to Salvatore Sanfilippo (antirez) for writing disque and Andy McCurdy, author of the redis-py module.