...

Text file src/github.com/google/flatbuffers/grpc/examples/python/greeter/models/greeter_grpc_fb.py

Documentation: github.com/google/flatbuffers/grpc/examples/python/greeter/models

     1# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
     2
     3import grpc
     4
     5class GreeterStub(object):
     6  """ Interface exported by the server. """  
     7  
     8  def __init__(self, channel):
     9    """ Constructor. 
    10    
    11    Args: 
    12    channel: A grpc.Channel. 
    13    """
    14    
    15    self.SayHello = channel.unary_unary(
    16      "/models.Greeter/SayHello"
    17      )
    18    
    19    self.SayManyHellos = channel.unary_stream(
    20      "/models.Greeter/SayManyHellos"
    21      )
    22    
    23
    24class GreeterServicer(object):
    25  """ Interface exported by the server. """  
    26  
    27  def SayHello(self, request, context):
    28    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    29    context.set_details('Method not implemented!')
    30    raise NotImplementedError('Method not implemented!')
    31  
    32  
    33  def SayManyHellos(self, request, context):
    34    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    35    context.set_details('Method not implemented!')
    36    raise NotImplementedError('Method not implemented!')
    37  
    38  
    39
    40def add_GreeterServicer_to_server(servicer, server):
    41  rpc_method_handlers = {
    42    'SayHello': grpc.unary_unary_rpc_method_handler(
    43      servicer.SayHello
    44    ),
    45    'SayManyHellos': grpc.unary_stream_rpc_method_handler(
    46      servicer.SayManyHellos
    47    ),
    48  }
    49  generic_handler = grpc.method_handlers_generic_handler(
    50    'models.Greeter', rpc_method_handlers)
    51  server.add_generic_rpc_handlers((generic_handler,))
    52

View as plain text