Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (74 sloc) 2.62 KB

Quickstart

Message Passing Patterns

Zeroless supports the following message passing patterns:

Push-Pull

.. literalinclude:: ../examples/pushPullServer.py
   :language: python

.. literalinclude:: ../examples/pushPullClient.py
   :language: python

Publisher-Subscriber

.. literalinclude:: ../examples/pubSubServer.py
   :language: python

.. literalinclude:: ../examples/pubSubClient.py
   :language: python

Request-Reply

.. literalinclude:: ../examples/reqRepServer.py
   :language: python

.. literalinclude:: ../examples/reqRepClient.py
   :language: python

Pair

.. literalinclude:: ../examples/pairServer.py
   :language: python

.. literalinclude:: ../examples/pairClient.py
   :language: python

Additional Features

Logging

Python provides a wonderfull logging module. It can be used to track Zeroless' internal workflow in a modular way, therefore being very useful for debugging purposes.

Multipart Messages

In the Zeroless API, all callables have a print like signature, therefore being able to have an infinite number of arguments. Each of these arguments are part of the whole message, that could be divided in multiple pieces. Being that useful when you have a simple message structure, with just a few fields, and don't want to rely on a data formatting standard (e.g. JSoN, XML) to maintain the message semantics. Also, given the need to parse those different parts that a single message may have, the receiver's iterable will return them all, at once, in transparent fashion.

For more on this, see the examples/multipart folder or check the following example:

.. literalinclude:: ../examples/multipart/pushPullServer.py
   :language: python

.. literalinclude:: ../examples/multipart/pushPullClient.py
   :language: python
You can’t perform that action at this time.