Skip to main content

Easy to use ZeroMQ based RPC library

Project description


Easy to use ZeroMQ based RPC library.


pip install ezrpc


Step 1

Create a Server

from ezrpc import Server

# By default, the server binds to all available interfaces
s = Server(server_port=5000, client_port=5001)

Run this with:


Step 2

Create a Worker

from ezrpc import Registry, ServerWorker
registry = Registry()

def add(a, b):
        return a + b

def multiply(a, b):
        return a * b

# Point the worker to the Server's IP
w = ServerWorker(sys.argv[1], registry, "tcp://")

Run as many workers as your server can handle:

python worker1
python worker2
python worker3

Workers are elastic, i.e. you can start and stop them at will and clients will continue to be served.

Step 3

Create a Client

from ezrpc import Client

# Point the client to the Server's IP
# timeout (millis) is optional, default is 5 seconds
c = Client('tcp://', timeout=1000)

for i in range(1,11):
        res = c.ask('add', i, 1)
        print 'Response: %s' % res


Run the client


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ezrpc, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size ezrpc-0.1.0.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page