diff --git a/.gitignore b/.gitignore index 2a72270..b447fbd 100644 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,8 @@ ENV/ # IDE specific folders .idea/ +.vscode/ # MacOS .DS_Store + diff --git a/README.rst b/README.rst index 111752f..00b1554 100644 --- a/README.rst +++ b/README.rst @@ -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. @@ -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 @@ -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 diff --git a/persistqueue/__init__.py b/persistqueue/__init__.py index 21b4ced..45960df 100644 --- a/persistqueue/__init__.py +++ b/persistqueue/__init__.py @@ -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 diff --git a/persistqueue/queue.py b/persistqueue/queue.py index bef4288..ba90364 100644 --- a/persistqueue/queue.py +++ b/persistqueue/queue.py @@ -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.