Giter VIP home page Giter VIP logo

nanoservice's Introduction

nanoservice

nanoservice is a small Python library for writing lightweight networked services using nanomsg

With nanoservice you can break up monolithic applications into small, specialized services which communicate with each other.

Build Status

Install

  1. Make sure you have the nanomsg library installed:
$ git clone [email protected]:nanomsg/nanomsg.git
$ ./configure
$ make
$ make check
$ sudo make install

For more details visit the official nanomsg repo

On OS X you can also do:

$ brew install nanomsg
  1. Install nanoservice:

From project directory

$ make install

Or via pip

$ pip install nanoservice (it's broken)

Example Usage

The service:

from nanoservice import Responder

def echo(msg):
    return msg

s = Responder('ipc:///tmp/service.sock')
s.register('echo', echo)
s.start()
$ python echo_service.py

The client:

from nanoservice import Requester

c = Requester('ipc:///tmp/service.sock')
res, err = c.call('echo', 'hello world’)
print('Result is {}'.format(res))
$ python my_client.py
$ Result is: hello world

Other

To run tests:

$ make test

To run benchmarks

$ make bench

Check out examples directory for more examples.

MIT Licensed

nanoservice's People

Contributors

evadot avatar walkr avatar jstasiak avatar

Watchers

Matt Giles avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.