![]() ![]() > import persistqueue > q = persistqueue. This queue does not allow duplicate items. Shrink_disk_usage perform a VACUUM against the sqlite, and rebuild the database file, this usually takes long time and frees a lot of disk space after get() SQLiteQueue ( 'mypath', auto_commit = True ) > q. get () 'str1' > del qĬlose the console, and then recreate the queue: > import persistqueue > q = persistqueue. To see the real performance on your host, run the script under benchmark/run_benchmark.py: python benchmark/run_benchmark.py Examples Example usage with a SQLite3 based queue > import persistqueue > q = persistqueue. The value above is in seconds for reading/writing 1000 items, the less Performance of Windows File Queue has dramatic improvement since v0.4.1 due to the Here are the time spent(in seconds) for writing/reading 1000 items to theĭisk comparing the sqlite3 and file queue. # for msgpack and cbor support, run 'pip install -r extra-requirements.txt' first python setup.py install Benchmark # for msgpack, cbor and mysql support, use following command pip install persist-queue from source code git clone Installation from pypi pip install persist-queue Python 2 was sunset on January 1, 2020, persist-queue will drop any Python 2 support in future version 1.0.0, no new feature will be developed under Python 2. Other queue implementations such as file based queue and sqlite3 based queue are still workable. Python 3.4 release has reached end of life andĭBUtils ceased support for Python 3.4, persist queue drops the support for python 3.4 since version 0.8.0. Multiple platforms support: Linux, macOS, Windowsīoth filed based queues and sqlite3 based queues are supportedįiled based queue: multiple serialization protocol support: pickle(default), msgpack, cbor, json Windows support (with Caution if persistqueue.Queue is used). Python 2.7 or Python 3.x (refer to Deprecation for future plan) This project is based on the achievements of python-pqueue Please refer to Pickling and unpickling extension types(Python2) Most built-in type, like int, dict, list are able to be persisted by persist-queue directly, to support customized objects, ![]() this is the motivation to start this project.īy default, persist-queue use pickle object serialization module to support object instances. After some try, I found it’s hard to achieve based on their current While queuelib and python-pqueue cannot fulfil all of above. Green-compatible: can be used in greenlet or eventlet environment. Recoverable: Items can be read after process restart. Thread-safe: can be used by multi-threaded producers and multi-threaded consumers. ![]() The goals is to achieve following requirements:ĭisk-based: each queued item should be stored in disk in case of any crash. Persist-queue implements a file-based queue and a serial of sqlite3-based queues. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |