Skip to main content

Stable old version of inet

Project description

# inet

**v0.2.4 has bug so you'll have to clone the head**

A simple library built on top of zeromq to enable different python
programs talk over sockets. It works using three components
*server*, *name service* and *client*. The main feature(or use) of this
library is its persistent name service

### Name Service
Start the inet server on command line
$ inetserver

### Server
The server is a function to respond to requests

from inet.inetclient import InetClient
from inet.server import RoutableServer

# talks with the inet server
proxy = InetClient('tcp://')

# frontend address is what clients connect to while backend address(unix socket)
# is what workers connect to
server = RoutableServer('testservice', proxy, 'tcp://',

def hello(req, resp):['greeting'] = 'World'
return resp

# spawn default(3) number of workers

### Client

from inet.inetclient import InetClient
from inet.client import Client

proxy = InetClient('tcp://')
client = Client(proxy)

# service name acts as protocol
resp = client.get('testservice://hello/world')
print(resp.meta['status']) # 200
print(['greeting']) # 'World'

*N.B*: Notes that it uses gevent for managing workers

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gakp-inet, version 0.2.9
Filename, size File type Python version Upload date Hashes
Filename, size gakp_inet-0.2.9-py3-none-any.whl (11.8 kB) File type Wheel Python version 3.4 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page