William Pitcock committed 79462be

Update README more.

  • Participants
  • Parent commits bc5e7e4

Comments (0)

Files changed (1)

 This is the RPC definition for Edia and some code for it.  It is meant to be used as a git submodule,
 and is shared by a few tortoiselabs products for RPC calling.
+## Using this as a Client
+Using this as a Client is simple enough, usually.  Here is a sample interactive python session:
+>>> from ediarpc import rpc_client
+>>> cli = rpc_client.ServerProxy('localhost', 5959, 'moocows')
+{u'hello': {}}
+{u'hello': {u'hello': u'world'}}
+>>>'value', key2=['list', 'of', 'values'], key3=True, key4=25.3)
+{u'hello': {u'key3': True, u'key2': [u'list', u'of', u'values'], u'key': u'value', u'key4': 25.3}}
+This is from a server which has a single method `ping(...)` which simply returns back the `kwargs`
+## Using this as a Server
+Simply `bind()` any function which takes a `kwargs` list and then run the server:
+>>> from ediarpc import rpc_server
+>>> def ping(**kwargs):
+...     return dict(hello=kwargs)
+>>> server = rpc_server.RPCServer(('', 5959), 'moocows')
+>>> server.bind(ping)
+>>> server.serve_forever()
 ## Call syntax