A persistent multi-producer multi-consumer gevent queue
Project description
gevent-queue
gevent-queue is a lightweight, stateful multi-producer and multi-consumer queue. It was designed to work inside gevent-based web apps (especially Flask) so that you only need a single process. If you later wish to scale, you can easily spawn separate worker processes.
gevent-queue supports Redis to persist enqueued messages.
Installing
Install and update using pip:
pip install -U gevent-queue
Usage Examples
Using workers:
import gevent_queue
import redis
r = redis.Redis()
worker = gevent_queue.Worker(r)
@worker.job
def myjob(arg):
print("foo", arg)
@worker.schedule("*/2 * * * *")
def every_2_minutes():
print("bar")
myjob.delay("myarg")
while True:
worker.step()
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
gevent-queue-0.1.4.tar.gz
(4.5 kB
view hashes)