vmagamedov / grpclib

Pure-Python gRPC implementation for asyncio
http://grpclib.readthedocs.io
BSD 3-Clause "New" or "Revised" License
936 stars 92 forks source link

How do I communicate with GO #149

Open lishichao1181 opened 2 years ago

lishichao1181 commented 2 years ago

How do I communicate with GO

lishichao1181 commented 2 years ago

class GreeterStub:

def __init__(self, channel: grpclib.client.Channel) -> None:
    self.SayHello = grpclib.client.UnaryUnaryMethod(
        channel,
        '/helloWorld.Greeter/SayHello',
        helloworld_pb2.HelloRequest,
        helloworld_pb2.HelloReply,
    )

自动生成的文件,路径变成小写了

helloworld修改为helloWorld,可以啦

vmagamedov commented 2 years ago

gh:vmagamedov/grpclib/.../helloworld.proto and gh:grpc/grpc-go/.../helloworld.proto are basically the same. You should be able to run examples from both projects in any combination.

Here is how to run grpclib examples: https://github.com/vmagamedov/grpclib/tree/master/examples.