Skip to content

Commit 5596ccf

Browse files
authored
Merge pull request #185 from peter-wangxu/update_doc
Update doc for file based queue
2 parents 2baeca6 + e02bf57 commit 5596ccf

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ ENV/
9090

9191
# IDE specific folders
9292
.idea/
93+
.vscode/
9394

9495
# MacOS
9596
.DS_Store
97+

README.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ The core functions:
229229
>>> ackq.nack(item) # Else mark item as `nack` so that it can be proceeded again by any worker
230230
>>> ackq.ack_failed(item) # Or else mark item as `ack_failed` to discard this item
231231
232-
Paramaters:
232+
Parameters:
233233

234234
- ``clear_acked_data``
235235
- ``max_delete`` (defaults to 1000): This is the LIMIT. How many items to delete.
@@ -274,6 +274,15 @@ Note:
274274
Example usage with a file based queue
275275
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
276276

277+
Parameters:
278+
279+
- ``path``: specifies the directory wher enqueued data persisted.
280+
- ``maxsize``: indicates the maximum size stored in the queue, if maxsize<=0 the queue is unlimited.
281+
- ``chunksize``: indicates how many entries should exist in each chunk file on disk. When a all entries in a chunk file was dequeued by get(), the file would be removed from filesystem.
282+
- ``tempdir``: indicates where temporary files should be stored. The tempdir has to be located on the same disk as the enqueued data in order to obtain atomic operations.
283+
- ``serializer``: controls how enqueued data is serialized.
284+
- ``auto_save``: `True` or `False`. By default, the change is only persisted when task_done() is called. If autosave is enabled, info data is persisted immediately when get() is called. Adding data to the queue with put() will always persist immediately regardless of this setting.
285+
277286
.. code-block:: python
278287
279288
>>> from persistqueue import Queue
@@ -285,6 +294,7 @@ Example usage with a file based queue
285294
'a'
286295
>>> q.task_done()
287296
297+
288298
Close the python console, and then we restart the queue from the same path,
289299

290300
.. code-block:: python

persistqueue/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding=utf-8
22
__author__ = 'Peter Wang'
33
__license__ = 'BSD'
4-
__version__ = '0.8.0-beta0'
4+
__version__ = '0.8.0'
55

66
from .exceptions import Empty, Full # noqa
77
from .queue import Queue # noqa

persistqueue/queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, path, maxsize=0, chunksize=100, tempdir=None,
7878
to read multiple values.
7979
8080
The autosave parameter controls when data removed from the queue is
81-
persisted. By default (disabled), the change is only persisted when
81+
persisted. By default, (disabled), the change is only persisted when
8282
task_done() is called. If autosave is enabled, data is persisted
8383
immediately when get() is called. Adding data to the queue with put()
8484
will always persist immediately regardless of this setting.

0 commit comments

Comments
 (0)