Skip to content

Commit

Permalink
event doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Nov 24, 2013
1 parent 5ee88e9 commit 6e07d16
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dist
*.pyc
pynsq.egg-info
build
docs/_build
6 changes: 6 additions & 0 deletions docs/async_conn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:class:`AsyncConn` -- a connection to nsqd
==========================================

.. autoclass:: nsq.AsyncConn
:members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Contents:
:maxdepth: 2

message
async_conn
reader
writer
legacy_reader
Expand Down
1 change: 1 addition & 0 deletions docs/message.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

.. autoclass:: nsq.Message
:members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/reader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Consumers

.. autoclass:: nsq.Reader
:members:
:inherited-members:
1 change: 1 addition & 0 deletions docs/writer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Producers

.. autoclass:: nsq.Writer
:members:
:inherited-members:
20 changes: 17 additions & 3 deletions nsq/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,22 @@ class AsyncConn(EventedMixin):
"""
Low level object representing a TCP connection to nsqd.
When a message on this connection is requeued, it can calculate the delay automatically
by an increasing multiple of ``requeue_delay``.
When a message on this connection is requeued and the requeue delay has not been specified,
it calculates the delay automatically by an increasing multiple of ``requeue_delay``.
Generates the following events that can be listened to with :meth:`nsq.AsyncConn.on`:
* ``connect``
* ``close``
* ``error``
* ``identify``
* ``identify_response``
* ``heartbeat``
* ``ready``
* ``message``
* ``response``
* ``backoff``
* ``resume``
:param host: the host to connect to
Expand All @@ -47,7 +61,7 @@ class AsyncConn(EventedMixin):
:param tls_v1: enable TLS v1 encryption (requires nsqd 0.2.22+)
:param tls_options: dictionary of options to pass to `ssl.wrap_socket()
<http://docs.python.org/2/library/ssl.html#ssl.wrap_socket>`_ as **kwargs
<http://docs.python.org/2/library/ssl.html#ssl.wrap_socket>`_ as ``**kwargs``
:param snappy: enable Snappy stream compression (requires nsqd 0.2.23+)
Expand Down
16 changes: 11 additions & 5 deletions nsq/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ class Message(EventedMixin):
If you want to perform asynchronous message processing use the
:meth:`nsq.Message.enable_async` method, pass the message around,
and respond using the appropriate instance method.
NOTE: A calling a message's .finish() and .requeue() methods positively and
negatively impact the backoff state, respectively. However, sending the
backoff=False keyword argument to .requeue() is considered neutral and
will not impact backoff state.
Generates the following events that can be listened to with :meth:`nsq.Message.on`:
* ``finish``
* ``requeue``
* ``touch``
NOTE: A calling a message's :meth:`nsq.Message.finish()` and :meth:`nsq.Message.requeue()`
methods positively and negatively impact the backoff state, respectively. However,
sending the ``backoff=False`` keyword argument to :meth:`nsq.Message.requeue()` is
considered neutral and will not impact backoff state.
:param id: the ID of the message
:type id: string
Expand Down

0 comments on commit 6e07d16

Please sign in to comment.