A port of the SRPC system for use in Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
srpc
.gitignore
LICENSE
README.md
setup.py

README.md

py-SRPC

A python port of the simple RPC (SRPC) system for connecting to the HWDB Cache instances.

Install

Prerequisites: pip

Just run:

$ git clone https://github.com/fergul/py-SRPC.git
$ cd py-SRPC
$ python setup.py install

The srpc module will become available for use along with hwdb.py and echoClient.py scripts

$ echoClient.py -h <host> -p <port> -s <service>
or
$ hwdb.py -h <host> -p <port> -s <service>

Example

from srpc import SRPC

srpc = SRPC(port=5001)
conn = srpc.connect("localhost", 5000, "service")
response = conn.call("Some query")
conn.disconnect()
srpc.close()

For a bigger example check out hwdb.py, which shows:

  • connecting to a HWDB Cache instance
  • creating a table, inserting
  • registering an automaton and listening for responses