Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A good persistent synchronous queue in python

Tags:

python

queue

I don't immediately care about fifo or filo options, but it might be nice in the future..

What I'm looking for a is a nice fast simple way to store (at most a gig of data or tens of millions of entries) on disk that can be get and put by multiple processes. The entries are just simple 40 byte strings, not python objects. Don't really need all the functionality of shelve.

I've seen this http://code.activestate.com/lists/python-list/310105/ It looks simple. It needs to be upgraded to the new Queue version.

Wondering if there's something better? I'm concerned that in the event of a power interruption, the entire pickled file becomes corrupt instead of just one record.

like image 294
Paul Avatar asked Dec 30 '11 17:12

Paul


1 Answers

Try using Celery. It's not pure python, as it uses RabbitMQ as a backend, but it's reliable, persistent and distributed, and, all in all, far better then using files or database in the long run.

like image 65
Pavel Shvedov Avatar answered Oct 20 '22 00:10

Pavel Shvedov