How to call grpc in flask

-sharp  flask  route
@app.route("/test")
def test():
  -sharp flask
  send_grpc()

-sharp  __main__ 
def send_grpc():
  channel = grpc.insecure_channel("server_host")
  client = something_pb2_grpc.SomethingStub(channel=channel)
  -sharp flask
  res = client.SayHello(
    something_pb2.Hellp(word="")
  )
  print res

does anyone know why this is? is flask and grpc incompatible?
is there any solution?

Sep.30,2021

has nothing to do with flask , it's my own pot. In the
code, it is caused by gevent typing monkey.patch_all () .
it should be that patch is incompatible with grpc .
it would be great if a friend could come up with a solution that is both patch and compatible.

explanation:
https://codeshelper.com/a/11.
solution:
https://github.com/grpc/grpc/.
https://github. Com/grpc/grpc/.

Menu