Skip to main content

0MQ based Service Oriented RPC Framework

Project description

The butler framework aims to make building reliable and high-performance service-oriented systems easy. The internal communication is done via ØMQ sockets.

Usage

Start a Router:

import butler

router = butler.Router()
router.frontend.bind("tcp://*:5555")
router.backend.bind("tcp://*:5556")
router.run()

Register a Service Worker by name:

worker = butler.Service('tcp://127.0.0.1:5556', 'api.images')

Expose a function on the Service Worker:

def resize_image(name, size):
    return 'resized image'

worker.register_function(resize_image)
worker.run()

Or expose all the methods of an object:

class RPCService(object):
    def resize_image(self, name, size):
        return 'resized image'

worker.register(RPCService())
worker.run()

Send a request to a registered Service and receive its response:

client = butler.Client('tcp://127.0.0.1:5555').rpc('api.images')
client.resize_image('test.jpeg', '150x180')
client.close()

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

butler-0.3.0.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file butler-0.3.0.tar.gz.

File metadata

  • Download URL: butler-0.3.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for butler-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0e6ea64446f0e603aa383437eb286e121880644a77dfd68da3e8784fad291526
MD5 c951796a8285666aa09fe2e60f2056ff
BLAKE2b-256 8b94ec04897a481c44cda6070863b6cc63f560242c56f832b5f60609d671c18d

See more details on using hashes here.

Supported by

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