https://github.com/walkr/nanoservice
nanoservice is a small Python library for writing lightweight networked services using nanomsg
https://github.com/walkr/nanoservice
nanomsg python
Last synced: about 1 month ago
JSON representation
nanoservice is a small Python library for writing lightweight networked services using nanomsg
- Host: GitHub
- URL: https://github.com/walkr/nanoservice
- Owner: walkr
- License: mit
- Created: 2014-07-06T20:01:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-29T06:16:45.000Z (over 9 years ago)
- Last Synced: 2025-03-29T08:17:29.734Z (2 months ago)
- Topics: nanomsg, python
- Language: Python
- Homepage:
- Size: 74.2 KB
- Stars: 31
- Watchers: 7
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
nanoservice
===========
nanoservice is a small Python library for writing lightweight networked services
using [nanomsg](http://nanomsg.org/)With nanoservice you can break up monolithic applications into small,
specialized services which communicate with each other.[](https://travis-ci.org/walkr/nanoservice)
## Install
1) Make sure you have the nanomsg library installed:
```shell
$ git clone [email protected]:nanomsg/nanomsg.git
$ ./configure
$ make
$ make check
$ sudo make install
```For more details visit the official [nanomsg repo](https://github.com/nanomsg/nanomsg)
On OS X you can also do:
```shell
$ brew install nanomsg
```2) Install nanoservice:
From project directory
```shell
$ make install
```Or via pip
```shell
$ pip install nanoservice (it's broken)
```## Example Usage
The service:
```python
from nanoservice import Responderdef echo(msg):
return msgs = Responder('ipc:///tmp/service.sock')
s.register('echo', echo)
s.start()
``````shell
$ python echo_service.py
```The client:
```python
from nanoservice import Requesterc = Requester('ipc:///tmp/service.sock')
res, err = c.call('echo', 'hello world’)
print('Result is {}'.format(res))
``````shell
$ python my_client.py
$ Result is: hello world
```## Other
To run tests:
```shell
$ make test
```To run benchmarks
```shell
$ make bench
```Check out examples directory for more examples.
MIT Licensed