https://github.com/jesus89/rainbow
Micro-framework for Python RPC+Pub/Sub over WebSockets
https://github.com/jesus89/rainbow
Last synced: 2 months ago
JSON representation
Micro-framework for Python RPC+Pub/Sub over WebSockets
- Host: GitHub
- URL: https://github.com/jesus89/rainbow
- Owner: Jesus89
- License: gpl-2.0
- Created: 2015-10-08T08:12:12.000Z (over 9 years ago)
- Default Branch: develop
- Last Pushed: 2016-04-04T08:22:35.000Z (about 9 years ago)
- Last Synced: 2025-03-24T07:26:13.143Z (3 months ago)
- Language: Python
- Homepage:
- Size: 261 KB
- Stars: 13
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![][rainbow]
[](http://opensource.org/licenses/GPL-2.0) [](https://travis-ci.org/Jesus89/rainbow)
Micro-framework for Python RPC+Pub/Sub communication over WebSockets
* Based on the [WAMP](http://wamp-proto.org/why/) protocol.
* Compatible with [JSON-RPC 2.0](http://www.jsonrpc.org/specification).
* JSON Events using the [Publish/Subscribe pattern](http://rfc.zeromq.org/spec:29).
* Syntax inspired by [Bottle](https://github.com/bottlepy/bottle).
* It includes [Avahi](http://www.avahi.org/) discovery service.## Installation
```bash
sudo apt-get install python-dev libzmq3-dev avahi-daemon# Disable avahi on init
sudo update-rc.d -f avahi-daemon removesudo pip install pyrainbow
```## Protocol
[Rainbow protocol](doc/protocol.md)
## Description
[API description](doc/api-description.md)
## Example
Basic example
```python
from rainbow import register, run@register
def add(a=0, b=0):
return a + brun(host='0.0.0.0')
```Publish example
```python
from rainbow import register, publish, run@register
def pub():
publish('event', 'data')run(host='0.0.0.0')
```Check more amazing [examples](https://github.com/Jesus89/rainbow/tree/develop/examples)!
[rainbow]: doc/images/rainbow.png