Python gRPC 回调方式实现CS通讯(类flask)
Project description
Documentation
The documentation is hosted at https://github.com/BingerYang/grpc_route
Installation
pip install grpc_route
Usage
server run:
from grpc_route.server import Router app = Router() @app.route("index") def test(n): # n / 0 print("-> to index: ", n) return "server back ->" if __name__ == "__main__": app.run_forever("0.0.0.0", port=5656)
client run:
from grpc_route.client import RouteClient from grpc_route import AddrConf addr1 = AddrConf("127.0.0.1", 5656) app = RouteClient(addr1) app.connect() @app.register(handler="index", to_addr=addr1) def run_index(n): pass
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grpc_route-0.1.2.20010521.tar.gz
(16.8 kB
view hashes)
Built Distribution
Close
Hashes for grpc_route-0.1.2.20010521.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37611f8f5feb2a25b0f418146c051178478eb78243a22fff63913948efce963f |
|
MD5 | 80ba2e13eae99ed0ca8315cb278acd4a |
|
BLAKE2b-256 | b90edc65775bc67313a60d57b167fbaa637f451c69d2313cc39e48390c601864 |
Close
Hashes for grpc_route-0.1.2.20010521-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 417f1023e61db82dcba46ad6f4b7f42a59bbbd78e380d45f35fbf48d0361fcc2 |
|
MD5 | 7bcc2406132439282cfc75de6b965483 |
|
BLAKE2b-256 | 5838d20e4c0cf9d83e27840fd10beb194b3f09a58432a58c2a79efa6d613035e |