You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it can't connect to first node, it will try to connect to second, etc.., if it can't connect to any node, it will raise a redis.exceptions.ConnectionError as you can imagine.
It will push the job "print" to the queue "test_queue" with a timeout of 100
ms, and return the id of the job if it was received and replicated
in time. If it can't reach the node - maybe it was shutdown etc. - it will retry to connect to another node in given node list, and then send the job. If there is no avail nodes in your node list, it will obviously raise a ConnectionError
Then, your workers will do something like this:
whileTrue:
jobs=client.get_job(['test_queue'])
forqueue_name, job_id, jobinjobs:
job=json.loads(job)
print">>> received job:", jobclient.ack_job(job_id)
also check examples directory.
While waiting jobs your connected node may go down, pydisque will try to connect to next node, so you can restart your nodes without taking down your clients.
Documentation
For now please check docstrings in disque/client.py, implemented commands are
info
add_job
get_job
ack_job
nack_job
fast_ack
working
qlen
qstat
qpeek
qscan
jscan
enqueue
dequeue
del_job
show
pause
hello
Installation
You can install it using pip.
$ pip install pydisque
License
This project is licensed under the terms of the MIT license