Socket
Book a DemoInstallSign in
Socket

grpc-route

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-route

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

0.1.2.20010521
pipPyPI
Maintainers
1

grpc_route

Documentation

The documentation is hosted at https://github.com/BingerYang/grpc_route

Installation

.. code:: shell

 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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.