Skip to main content

Python gRPC 回调方式实现CS通讯(类flask)

Project description


The documentation is hosted at


pip install grpc_route


server run:

from grpc_route.server import Router

app = Router()

def test(n):
    # n / 0
    print("-> to index: ", n)
    return "server back ->"

if __name__ == "__main__":
    app.run_forever("", port=5656)

client run:

from grpc_route.client import RouteClient
from grpc_route import AddrConf

addr1 = AddrConf("", 5656)
app = RouteClient(addr1)

@app.register(handler="index", to_addr=addr1)
def run_index(n):

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 grpc-route, version
Filename, size File type Python version Upload date Hashes
Filename, size grpc_route- (22.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size grpc_route- (16.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page