Skip to content

Commit

Permalink
update publisher documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
semiversus committed Sep 27, 2018
1 parent ee989b9 commit 4dd9e27
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
10 changes: 6 additions & 4 deletions broqer/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ class Publisher():
publisher/subscriber are referenced as observable/observer.
As information receiver use following method to interact with Publisher
.subscribe(subscriber) to subscribe for events on this publisher
.unsubscribe(subscriber) to unsubscribe
.get() to get the current state (will raise ValueError if not stateful)
* ``.subscribe(subscriber)`` to subscribe for events on this publisher
* ``.unsubscribe(subscriber)`` to unsubscribe
* ``.get()`` to get the current state (will raise ValueError if not stateful)
When implementing a Publisher use the following methods:
.notify(value) calls .emit(value) on all subscribers
* ``.notify(value)`` calls .emit(value) on all subscribers
:ivar _subscriptions: holding a list of subscribers
"""
Expand Down
12 changes: 12 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@
(master_doc, 'python-broqer.tex', 'python-broqer Documentation',
u'Günther Jena', 'manual'),
]

from sphinx.ext import autodoc

class SimpleDocumenter(autodoc.ClassDocumenter):
objtype = "classdoc"

#do not indent the content
content_indent = ""

#do not add a header to the docstring
def add_directive_header(self, sig):
pass
3 changes: 3 additions & 0 deletions docs/publishers.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Publishers
==========

.. autoclassdoc:: broqer.Publisher

Publisher
---------
.. autoclass:: broqer.Publisher
:members: subscribe, unsubscribe, get, notify, subscriptions, wait_for

StatefulPublisher
-----------------
Expand Down

0 comments on commit 4dd9e27

Please sign in to comment.