Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

Commit

Permalink
docstring fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slimeth committed Feb 5, 2019
1 parent 271cead commit 9b9a710
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions persipubsub/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def init(self,
:param max_readers: max number of reader of the lmdb
:param max_size: max size of the lmdb in bytes
:param high_watermark: high water mark limit of the queue
:param strategy: used to prune queue
:return:
"""
if self.check_queue_is_initialized():
Expand Down Expand Up @@ -179,6 +180,7 @@ def _initialize_queue(self,
:param max_readers: max number of reader of the lmdb
:param max_size: max size of the lmdb in bytes
:param high_watermark: high water mark limit of the queue
:param strategy: used to prune queue
:return:
"""
if not self.path.exists():
Expand Down
15 changes: 13 additions & 2 deletions persipubsub/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
class Environment:
"""Fabricate persipubsub components."""

def __init__(self, path: pathlib.Path):
"""Initialize."""
def __init__(self, path: pathlib.Path) -> None:
"""
Initialize.
:param path: to the queue
"""
self.path = path

def __enter__(self) -> 'Environment':
Expand All @@ -38,7 +42,13 @@ def new_control(self,
"""
Fabricate a new control.
:param subscriber_ids: subscribers of the queue
:param max_readers: max number of reader of the lmdb
:param max_size: max size of the lmdb in bytes
:param high_watermark: high water mark limit of the queue
:return: Control to initialize queues
:param strategy: used to prune queue
:return: Control to create and maintain queue
"""
control = persipubsub.control.Control(path=self.path)
control.init(
Expand All @@ -54,6 +64,7 @@ def new_publisher(
"""
Fabricate a new publisher.
:param autosync: if True, store data automatically in lmdb
:return: Publisher to send messages
"""
publisher = persipubsub.publisher.Publisher()
Expand Down
5 changes: 0 additions & 5 deletions persipubsub/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ class Publisher:
"""
Create Publisher ready to send messages.
:ivar pub_id: publisher ID
:vartype pub_id: str
:ivar queue: on which messages are published
:vartype queue: persipubsub.queue.Queue
:ivar sub_list: list of subscriber to which messages are send
:vartype sub_list: List[str]
:ivar autosync: sync after each message or after multiple messages
:vartype autosync: bool
"""
Expand All @@ -33,7 +29,6 @@ def init(self, path: Union[pathlib.Path, str],
"""
Initialize.
:param pub_id: constant ID of publisher
:param path: path to the queue
:param autosync: if True, store data automatically in lmdb
"""
Expand Down
2 changes: 1 addition & 1 deletion persipubsub/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class _Queue:
"""
Queue messages persistently from many publishers for many subscribers.
:ivar config_pth: path to the JSON config file
:ivar path: to the queue
:vartype config_pth: pathlib.Path
:ivar env: LMDB environment on disk
:vartype env: lmdb.Environment
Expand Down

0 comments on commit 9b9a710

Please sign in to comment.