Not Logged In

pseud 0.0.5

Pythonic bidirectional-rpc API built on top of ØMQ with pluggable
encryption, authentication and heartbeating support.

Features

ØMQ transport layer.

All native python types supported (msgpack).

First citizen exceptions.

Bi-bidirectional (server can initiate calls to connected clients).

Encryption based on CURVE.

Pluggable Authentication.

Pluggable Heartbeating.

Pluggable Remote Call Routing.

Works with tornado ioloop or gevent.

Built-in proxy support. A server can delegate the work to another one.

SyncClient (using zmq.REQ) to use within non event based processes.
(Heartbeating, Authentication and job execution are not supported with
the SyncClient.)

Installation

Dependencies are declared in setup.py and all automatically installed, but,
pyzmq might build libzmq from bundled folder OR from your system wide libzmq.
In later case you should make sure libzmq has been compiled with libsodium
to take advantage of curve security features.

We recommend to install pyzmq with bundled libzmq explicitely if libzmq is
already installed on your system.

$ pip install pyzmq --install-option='--zmq=bundled'

Tornado

$ pip install -e .[Tornado]

Gevent

$ pip install -e .[Gevent]

Execution

If both backends are installed, tornado is used by default.
To force gevent over tornado, set the environment variable $NO_TORNADO to
something.

$NO_TORNADO=1 python script.py

Preview

The tornado Server

frompseudimportServerserver=Server('service')server.bind('tcp://127.0.0.1:5555')@server.register_rpcdefhello(name):return'Hello {0}'.format(name)server.start()# this will block forever

The tornado Client

# Assume the tornado IOLoop is runningfrompseudimportClientclient=Client('service',identity='client1',io_loop=loop)client.connect('tcp://127.0.0.1:5555')# Assume we are inside a coroutineresponse=yieldclient.hello('Charly')assertresponse=='Hello Charly'@client.register_rpc(name='draw.me.a.sheep')defsheep():return'beeeh'