Permalink
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (54 sloc) 1.43 KB

pseud a bidirectionnal RPC library ready for the hostile web

Initialize an RPC peer playing as a server

# The server
from pseud import Server


server = Server('service')
server.bind('tcp://127.0.0.1:5555')

@server.register_rpc
def hello(name):
    return 'Hello {0}'.format(name)

await server.start() # this would block within its own io_loop

Prepare a client

from pseud import Client


client = Client('service')
client.connect('tcp://127.0.0.1:5555')

then make a remote procedure call (rpc)

# Assume we are inside a coroutine
async with client:
     response = await client.hello('Charly')
     assert response == 'Hello Charly'

Narrative Documentation

.. toctree::
   :maxdepth: 2

   intro
   remote-calls
   authentication
   heartbeating
   job-routing
   protocol
   interfaces
   changelog

API Documentation

.. toctree::
   :maxdepth: 1
   :glob:

   api/*


Indices and tables

.. toctree::
   :hidden:

   glossary