Permalink
Browse files

Improved documentation

  • Loading branch information...
hgrecco committed Jan 9, 2013
1 parent 4e7a198 commit cf53aa25c598606f39a4b8753e8b074144b94ea3
Showing with 13 additions and 10 deletions.
  1. +5 −3 docs/index.rst
  2. +2 −2 docs/serve_in_process.rst
  3. +6 −5 docs/signals.rst
View
@@ -1,6 +1,6 @@
-Pizco: Python remoting via ZMQ
-==============================
+Pizco: Python remoting with ZMQ
+===============================
.. image:: _static/pizco.png
:alt: Pizco: remoting in Python with ZMQ
@@ -89,11 +89,13 @@ Pizco in action
proxy = Proxy('tcp://127.0.0.1:8000')
+ print('{} * {} = {}'.format(proxy.factor, 8, proxy.calculate(8)))
+
def on_factor_changed(new_value, old_value):
print('The factor was changed from {} to {}'.format(old_value, new_value))
print('{} * {} = {}'.format(proxy.factor, 8, proxy.calculate(8)))
- print('{} * {} = {}'.format(proxy.factor, 8, proxy.calculate(8)))
+ proxy.factor_changed.connect(on_factor_changed)
for n in (3, 4, 5):
proxy.factor = n
@@ -16,8 +16,8 @@ You can directly start the server from the client application::
print(robot_proxy.age)
-A new process is started using the same python interpreter. `Pizco` will provide
-this new process with the path of the `Robot` class but you need to be sure that
+The server is started in a new instance of the same python interpreter. `Pizco` will
+provide this new process with the path of the `Robot` class but you need to be sure that
any other dependency is available.
If the `Robot` constructor takes some arguments you can give them like this::
View
@@ -19,11 +19,11 @@ The syntax in the client side is exactly as it is done in PyQt_/PySide_
Under the hood, the proxy is subscribing to an event in the server
using a ZMQ SUB socket. When the `arm_moved` signal is emitted server-side,
the server will **asynchronously** notify the proxy using a PUB socket.
-The proxy will call `hey` when it receives message. So you have client side
-notification of server side events.
+The proxy will call `print_notification` when it receives message. So you
+have client side notification of server side events.
It is important to note that if you are using PyQt/PySide signals in your
-code, no modification is needed to used `Pizco`. But not only PyQt/PySide
+code, no modification is needed to use `Pizco`. But not only PyQt/PySide
signals work. An attribute is considered `Signal` if it exposes at least
three methods: `connect`, `disconnect` and `emit`.
@@ -32,8 +32,9 @@ Just like PyQt, multiple slots can be connected to the same signal::
proxy.arm_moved.connect(print_notification)
proxy.arm_moved.connect(mail_notification)
-and they will be called in the order that they were added. To disconnect
-from a signal::
+and they will be called in the order that they were added.
+
+To disconnect from a signal::
proxy.arm_moved.disconnect(mail_notification)

0 comments on commit cf53aa2

Please sign in to comment.