Skip to content

Commit

Permalink
Update doc for file based queue
Browse files Browse the repository at this point in the history
fixes: #184
  • Loading branch information
peter-wangxu committed May 21, 2022
1 parent 2baeca6 commit e02bf57
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ ENV/

# IDE specific folders
.idea/
.vscode/

# MacOS
.DS_Store

12 changes: 11 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ The core functions:
>>> ackq.nack(item) # Else mark item as `nack` so that it can be proceeded again by any worker
>>> ackq.ack_failed(item) # Or else mark item as `ack_failed` to discard this item
Paramaters:
Parameters:

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

Parameters:

- ``path``: specifies the directory wher enqueued data persisted.
- ``maxsize``: indicates the maximum size stored in the queue, if maxsize<=0 the queue is unlimited.
- ``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.
- ``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.
- ``serializer``: controls how enqueued data is serialized.
- ``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.

.. code-block:: python
>>> from persistqueue import Queue
Expand All @@ -285,6 +294,7 @@ Example usage with a file based queue
'a'
>>> q.task_done()
Close the python console, and then we restart the queue from the same path,

.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion persistqueue/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding=utf-8
__author__ = 'Peter Wang'
__license__ = 'BSD'
__version__ = '0.8.0-beta0'
__version__ = '0.8.0'

from .exceptions import Empty, Full # noqa
from .queue import Queue # noqa
Expand Down
2 changes: 1 addition & 1 deletion persistqueue/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, path, maxsize=0, chunksize=100, tempdir=None,
to read multiple values.
The autosave parameter controls when data removed from the queue is
persisted. By default (disabled), the change is only persisted when
persisted. By default, (disabled), the change is only persisted when
task_done() is called. If autosave is enabled, data is persisted
immediately when get() is called. Adding data to the queue with put()
will always persist immediately regardless of this setting.
Expand Down

0 comments on commit e02bf57

Please sign in to comment.