forked from sbenzev/speedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·72 lines (53 loc) · 1.65 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python
from setuptools import setup, find_packages, Command, Extension
#from Cython.Distutils import build_ext
setup(
name="speedy",
description="Fast, non-blocking RPC system.",
version="0.23",
author="Russell Power",
author_email="[email protected]",
license="BSD",
url="http://github.com/rjpower/speedy",
package_dir={ 'speedy' : 'speedy' },
packages=['speedy'],
install_requires=['pyzmq'],
long_description='''
Speedy - A Fast RPC System for Python
=====================================
A fast non-blocking RPC library for Python.
Installation
------------
pip install [--user] speedy
or
easy_install speedy
Usage
-----
##### Imports
import speedy
from speedy import zeromq
##### Server
class MyServer(speedy.Server):
def foo(self, handle, request):
handle.done(do_something(request.foo, request.bar))
server = MyServer(zeromq.server_socket(('127.0.0.1', port)))
# or use -1 to have the server grab an open port
# server = MyServer(zeromq.server_socket(('127.0.0.1', -1)))
server.serve() # blocks until server exits
##### Client
client = speedy.Client(zeromq.client_socket(('127.0.0.1', server_port)))
# requests are arbitrary python objects
request = { 'foo' : 123, 'bar' : 456 }
future = client.foo(request)
# Wait for the result. If the server encountered an error,
# an speedy.RemoteException will be thrown.
result = future.wait()
Feedback
--------
Questions, comments: <[email protected]>
''',
# cmdclass={'build_ext': build_ext},
# ext_modules=[
# Extension("speedy.core", ["speedy/core.pyx"])
# ]
)