Skip to main content

RPC between distributed workers

Project description

A distributed RPC solution based on ØMQ and gevent. Follow the features:

  • A worker can return, yield, raise any picklable object to the remote customer.

  • A customer can invoke to any remote worker in the worker cluster.

  • A customer can invoke to all remote workers in the worker cluster.

Example

Server-side

import zmq.green as zmq
import zeronimo

class Application(object):

    def rycbar123(self):
        for word in 'run, you clever boy; and remember.'.split():
            yield word

ctx = zmq.Context()
worker_sock = ctx.socket(zmq.PULL)
worker_sock.bind('ipc://worker')

worker = zeronimo.Worker(Application(), [worker_sock])
worker.run()

Client-side

import zmq.green as zmq
import zeronimo

ctx = zmq.Context()
customer_sock = ctx.socket(zmq.PULL)
customer_sock.bind('ipc://customer')
tunnel_sock = ctx.socket(zmq.PUSH)
tunnel_sock.connect('ipc://worker')

customer = zeronimo.Customer(customer_sock, 'ipc://customer')
with customer.link([tunnel_sock]) as tunnel:
    for line in tunnel.rycbar123():
        print line

Project details


Download files

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

Source Distribution

zeronimo-0.0.dev.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file zeronimo-0.0.dev.tar.gz.

File metadata

  • Download URL: zeronimo-0.0.dev.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zeronimo-0.0.dev.tar.gz
Algorithm Hash digest
SHA256 b910ee1006d0324732e711ce1309ee12dd66131e5938fc3a807d0b3e10b470f8
MD5 e78088a6afcc691b1cb8896f840d3f98
BLAKE2b-256 cacfc7f8bf94f830adf5d5e3f48a3a957d6a6de0e88e8ce414b9442c3a6a94f5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page