Permalink
Browse files

new concepts: Invocation, Reply frame and ACCEPT/REJECT method

  • Loading branch information...
sublee committed Apr 5, 2013
1 parent a2d3f52 commit d7524d82775c42fa6daed7dee13a93bcb4d14077
Showing with 258 additions and 258 deletions.
  1. +22 −3 setup.py
  2. +206 −131 zeronimo/core.py → zeronimo.py
  3. +0 −18 zeronimo/__init__.py
  4. +0 −16 zeronimo/exceptions.py
  5. +0 −39 zeronimo/functional.py
  6. +30 −51 zeronimotests.py
View
@@ -11,6 +11,14 @@
- A customer can invoke to any remote worker in the worker cluster.
- A customer can invoke to all remote workers in the worker cluster.
+.. _ZeroMQ: http://www.zeromq.org/
+
+Example
+=======
+
+Server-side
+-----------
+
.. sourcecode:: python
import socket
@@ -28,15 +36,26 @@ def whoami(self):
yield sock.getsockname()[0]
worker = zeronimo.Worker(Application())
+ worker.bind('ipc://worker')
+ worker.bind_fanout('ipc://worker_fanout')
+ worker.subscribe('')
+ worker.run()
+
+Client-side
+-----------
+
+.. sourcecode:: python
+
+ import zeronimo
+
customer = zeronimo.Customer()
+ customer.bind('ipc://customer')
- with customer.link([worker]) as tunnel:
+ with customer.link(['ipc://worker'], ['ipc://worker_fanout']) as tunnel:
for result in tunnel(fanout=True).whoami():
print 'hostname=', result.next()
print 'public address=', result.next()
-.. _ZeroMQ: http://www.zeromq.org/
-
"""
from __future__ import with_statement
import distutils
Oops, something went wrong.

0 comments on commit d7524d8

Please sign in to comment.