This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A Lightweight RPC framework for Python

Project Description
thinrpc: A Lightweight RPC Framework for Python
===

This library provides a base class and some decorators to make it easy to build distributed applications. RPC endpoints are defined as class methods and decorated with ```RpcModule.Method```, which registers the endpoint with the event-based RPC server dispatching requests to registered methods.

The ```RpcRemote``` class is an abstraction allowing applications to invoke methods on remote nodes using method call syntax. See the example below for an illustration!

```python
'''
Simple RPC server responding to invocations of the
'hello' method with a pleasant greeting
'''
import sys

from thinrpc import RpcModule, RpcRemote, RpcApplication, OK

class FooNode(RpcApplication):

def __init__(self, port, name):
self.addr = ("localhost", port)
self.name = name

# Start the RPC server
self.Start()

@RpcModule.Method
def hello(self, sender):
return OK, "Hi, %s! It's %s" % (sender, self.name)


if __name__ == '__main__':
node = FooNode(9090, "Anson")
```

And now for a simple client script that invokes the ```hello``` method on the server application defined above.

```python

import thinrpc
import sys

# Say hi to the server!
server = thinrpc.RpcRemote(("localhost", 9090))
print(server.hello())
#{'result': "Hi, ('127.0.0.1', 49440)! It's Anson", 'err': False}
```
Release History

Release History

This version
History Node

0.2.0

History Node

0.1.24

History Node

0.1.23

History Node

0.1.22

History Node

0.1.21

History Node

0.1.20

History Node

0.1.19

History Node

0.1.18

History Node

0.1.17

History Node

0.1.16

History Node

0.1.15

History Node

0.1.14

History Node

0.1.13

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
thinrpc-0.2.0.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256 Source Jul 14, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting