Skip to main content

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 git@github.com: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

Release files for nanoservice 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nanoservice 0.7.2
File Size Uploaded
nanoservice-0.7.2.tar.gz 10.4 kB Details

Release files / nanoservice-0.7.2.tar.gz

Download URL nanoservice-0.7.2.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eb0413df8040c96cfd3b0f5ffee1f4b48b03c00327bd561136f16aac4612f168
BLAKE2b-256 checksum
How to use checksums
a22557e57f3879192e9f46719cf9afeacd2ea306159b854e9e973ea46deb1bf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.7.2 This release

1 release file

0.6.0

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.3.1

1 release file

0.3.0

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page