https://github.com/scieloorg/thriftpy-wrap
Helps you build console-based thrift servers.
https://github.com/scieloorg/thriftpy-wrap
Last synced: 5 months ago
JSON representation
Helps you build console-based thrift servers.
- Host: GitHub
- URL: https://github.com/scieloorg/thriftpy-wrap
- Owner: scieloorg
- Created: 2015-04-09T18:48:13.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-06-25T17:58:21.000Z (almost 8 years ago)
- Last Synced: 2024-04-14T20:25:32.677Z (about 2 years ago)
- Language: Python
- Size: 6.84 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
thriftpy-wrap
=============
A thin wrap around thriftpy to help you create console based server applications.
It also extends thriftpy in order to make possible to run the server against
already opened sockets.
.. code-block:: python
import thriftpy
import thriftpywrap
spec = thriftpy.load('dsl.thrift')
class Handler(object)
""" Remote procedures """
if __name__ == '__main__':
app = thriftpywrap.ConsoleApp(spec.Service, Handler)
app()
Executing this script will result is something like:
.. code-block:: bash
$ python ping_server.py
usage: ping_server.py [-h] [--port PORT]
[--address-family {AF_APPLETALK,AF_DECnet,AF_INET,AF_INET6,AF_IPX,AF_ROUTE,AF_SNA,AF_UNIX,AF_UNSPEC}]
(--host HOST | --unix-socket UNIX_SOCKET | --fd FD)
[--loglevel LOGLEVEL]
[arguments [arguments ...]]
ping_server.py: error: one of the arguments --host --unix-socket --fd is required