当前位置: 首页>>代码示例>>Python>>正文


Python grpc.unary_unary_rpc_method_handler方法代码示例

本文整理汇总了Python中grpc.unary_unary_rpc_method_handler方法的典型用法代码示例。如果您正苦于以下问题:Python grpc.unary_unary_rpc_method_handler方法的具体用法?Python grpc.unary_unary_rpc_method_handler怎么用?Python grpc.unary_unary_rpc_method_handler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grpc的用法示例。


在下文中一共展示了grpc.unary_unary_rpc_method_handler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add_QueryService_v1Servicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_QueryService_v1Servicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Find': grpc.unary_unary_rpc_method_handler(
          servicer.Find,
          request_deserializer=queries__pb2.Query.FromString,
          response_serializer=qry__responses__pb2.QueryResponse.SerializeToString,
      ),
      'FetchCommits': grpc.unary_stream_rpc_method_handler(
          servicer.FetchCommits,
          request_deserializer=queries__pb2.BlocksQuery.FromString,
          response_serializer=qry__responses__pb2.BlockQueryResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'iroha.protocol.QueryService_v1', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:hyperledger,项目名称:iroha-python,代码行数:18,代码来源:endpoint_pb2_grpc.py

示例2: add_GreeterServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_GreeterServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SayHello': grpc.unary_unary_rpc_method_handler(
          servicer.SayHello,
          request_deserializer=worldhello__pb2.HelloRequest.FromString,
          response_serializer=worldhello__pb2.HelloReply.SerializeToString,
      ),
      'SayHelloAgain': grpc.unary_unary_rpc_method_handler(
          servicer.SayHelloAgain,
          request_deserializer=worldhello__pb2.HelloRequest.FromString,
          response_serializer=worldhello__pb2.HelloReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'worldhello.Greeter', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:shanbay,项目名称:sea,代码行数:18,代码来源:worldhello_pb2_grpc.py

示例3: add_GreeterServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_GreeterServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'SayHello': grpc.unary_unary_rpc_method_handler(
            servicer.SayHello,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloReply.SerializeToString,
        ),
        'SayHelloAgain': grpc.unary_unary_rpc_method_handler(
            servicer.SayHelloAgain,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'worldhello.Greeter', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:shanbay,项目名称:sea,代码行数:18,代码来源:worldhello_pb2.py

示例4: add_pcoccNodeServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_pcoccNodeServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'route_command': grpc.unary_unary_rpc_method_handler(
          servicer.route_command,
          request_deserializer=agent__pb2.RouteMessage.FromString,
          response_serializer=agent__pb2.RouteMessageResult.SerializeToString,
      ),
      'route_stream': grpc.stream_stream_rpc_method_handler(
          servicer.route_stream,
          request_deserializer=agent__pb2.McastMessage.FromString,
          response_serializer=agent__pb2.RouteMessageResult.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'pcoccNode', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:cea-hpc,项目名称:pcocc,代码行数:18,代码来源:agent_pb2_grpc.py

示例5: add_OnlineActionHandlerServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_OnlineActionHandlerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      '_remote_execute': grpc.unary_unary_rpc_method_handler(
          servicer._remote_execute,
          request_deserializer=actions__pb2.OnlineActionRequest.FromString,
          response_serializer=actions__pb2.OnlineActionResponse.SerializeToString,
      ),
      '_remote_reload': grpc.unary_unary_rpc_method_handler(
          servicer._remote_reload,
          request_deserializer=actions__pb2.ReloadRequest.FromString,
          response_serializer=actions__pb2.ReloadResponse.SerializeToString,
      ),
      '_health_check': grpc.unary_unary_rpc_method_handler(
          servicer._health_check,
          request_deserializer=actions__pb2.HealthCheckRequest.FromString,
          response_serializer=actions__pb2.HealthCheckResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'OnlineActionHandler', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:marvin-ai,项目名称:marvin-python-toolbox,代码行数:23,代码来源:actions_pb2_grpc.py

示例6: add_BatchActionHandlerServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_BatchActionHandlerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      '_remote_execute': grpc.unary_unary_rpc_method_handler(
          servicer._remote_execute,
          request_deserializer=actions__pb2.BatchActionRequest.FromString,
          response_serializer=actions__pb2.BatchActionResponse.SerializeToString,
      ),
      '_remote_reload': grpc.unary_unary_rpc_method_handler(
          servicer._remote_reload,
          request_deserializer=actions__pb2.ReloadRequest.FromString,
          response_serializer=actions__pb2.ReloadResponse.SerializeToString,
      ),
      '_health_check': grpc.unary_unary_rpc_method_handler(
          servicer._health_check,
          request_deserializer=actions__pb2.HealthCheckRequest.FromString,
          response_serializer=actions__pb2.HealthCheckResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'BatchActionHandler', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:marvin-ai,项目名称:marvin-python-toolbox,代码行数:23,代码来源:actions_pb2_grpc.py

示例7: add_OnlineActionHandlerServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_OnlineActionHandlerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        '_remote_execute': grpc.unary_unary_rpc_method_handler(
            servicer._remote_execute,
            request_deserializer=OnlineActionRequest.FromString,
            response_serializer=OnlineActionResponse.SerializeToString,
        ),
        '_remote_reload': grpc.unary_unary_rpc_method_handler(
            servicer._remote_reload,
            request_deserializer=ReloadRequest.FromString,
            response_serializer=ReloadResponse.SerializeToString,
        ),
        '_health_check': grpc.unary_unary_rpc_method_handler(
            servicer._health_check,
            request_deserializer=HealthCheckRequest.FromString,
            response_serializer=HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'OnlineActionHandler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:marvin-ai,项目名称:marvin-python-toolbox,代码行数:23,代码来源:actions_pb2.py

示例8: add_BatchActionHandlerServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_BatchActionHandlerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        '_remote_execute': grpc.unary_unary_rpc_method_handler(
            servicer._remote_execute,
            request_deserializer=BatchActionRequest.FromString,
            response_serializer=BatchActionResponse.SerializeToString,
        ),
        '_remote_reload': grpc.unary_unary_rpc_method_handler(
            servicer._remote_reload,
            request_deserializer=ReloadRequest.FromString,
            response_serializer=ReloadResponse.SerializeToString,
        ),
        '_health_check': grpc.unary_unary_rpc_method_handler(
            servicer._health_check,
            request_deserializer=HealthCheckRequest.FromString,
            response_serializer=HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'BatchActionHandler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:marvin-ai,项目名称:marvin-python-toolbox,代码行数:23,代码来源:actions_pb2.py

示例9: add_GeolocationServerServiceServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_GeolocationServerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ResolveTDOA': grpc.unary_unary_rpc_method_handler(
                    servicer.ResolveTDOA,
                    request_deserializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveTDOARequest.FromString,
                    response_serializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveTDOAResponse.SerializeToString,
            ),
            'ResolveMultiFrameTDOA': grpc.unary_unary_rpc_method_handler(
                    servicer.ResolveMultiFrameTDOA,
                    request_deserializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveMultiFrameTDOARequest.FromString,
                    response_serializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveMultiFrameTDOAResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'geo.GeolocationServerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
开发者ID:brocaar,项目名称:chirpstack-api,代码行数:21,代码来源:geo_pb2_grpc.py

示例10: add_DeviceQueueServiceServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_DeviceQueueServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Enqueue': grpc.unary_unary_rpc_method_handler(
                    servicer.Enqueue,
                    request_deserializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.EnqueueDeviceQueueItemRequest.FromString,
                    response_serializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.EnqueueDeviceQueueItemResponse.SerializeToString,
            ),
            'Flush': grpc.unary_unary_rpc_method_handler(
                    servicer.Flush,
                    request_deserializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.FlushDeviceQueueRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'List': grpc.unary_unary_rpc_method_handler(
                    servicer.List,
                    request_deserializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.ListDeviceQueueItemsRequest.FromString,
                    response_serializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.ListDeviceQueueItemsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'api.DeviceQueueService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
开发者ID:brocaar,项目名称:chirpstack-api,代码行数:26,代码来源:deviceQueue_pb2_grpc.py

示例11: add_RibApiServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_RibApiServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Modify': grpc.stream_stream_rpc_method_handler(
          servicer.Modify,
          request_deserializer=nokia__rib__api__pb2.ModifyRequest.FromString,
          response_serializer=nokia__rib__api__pb2.ModifyResponse.SerializeToString,
      ),
      'GetVersion': grpc.unary_unary_rpc_method_handler(
          servicer.GetVersion,
          request_deserializer=nokia__rib__api__pb2.VersionRequest.FromString,
          response_serializer=nokia__rib__api__pb2.VersionResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Nokia.SROS.RibApi', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:nokia,项目名称:SROS-grpc-services,代码行数:18,代码来源:nokia_rib_api_pb2_grpc.py

示例12: add_ModelServiceServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_ModelServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'publishLoad': grpc.unary_unary_rpc_method_handler(
          servicer.publishLoad,
          request_deserializer=model__service__pb2.PublishRequest.FromString,
          response_serializer=model__service__pb2.PublishResponse.SerializeToString,
      ),
      'publishBind': grpc.unary_unary_rpc_method_handler(
          servicer.publishBind,
          request_deserializer=model__service__pb2.PublishRequest.FromString,
          response_serializer=model__service__pb2.PublishResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.fate.api.mlmodel.manager.ModelService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:FederatedAI,项目名称:FATE,代码行数:18,代码来源:model_service_pb2_grpc.py

示例13: add_InferenceServiceServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_InferenceServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'inference': grpc.unary_unary_rpc_method_handler(
          servicer.inference,
          request_deserializer=inference__service__pb2.InferenceMessage.FromString,
          response_serializer=inference__service__pb2.InferenceMessage.SerializeToString,
      ),
      'startInferenceJob': grpc.unary_unary_rpc_method_handler(
          servicer.startInferenceJob,
          request_deserializer=inference__service__pb2.InferenceMessage.FromString,
          response_serializer=inference__service__pb2.InferenceMessage.SerializeToString,
      ),
      'getInferenceResult': grpc.unary_unary_rpc_method_handler(
          servicer.getInferenceResult,
          request_deserializer=inference__service__pb2.InferenceMessage.FromString,
          response_serializer=inference__service__pb2.InferenceMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.fate.api.serving.InferenceService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:FederatedAI,项目名称:FATE,代码行数:23,代码来源:inference_service_pb2_grpc.py

示例14: add_DataTransferServiceServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_DataTransferServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'push': grpc.stream_unary_rpc_method_handler(
          servicer.push,
          request_deserializer=fate__proxy__pb2.Packet.FromString,
          response_serializer=fate__proxy__pb2.Metadata.SerializeToString,
      ),
      'pull': grpc.unary_stream_rpc_method_handler(
          servicer.pull,
          request_deserializer=fate__proxy__pb2.Metadata.FromString,
          response_serializer=fate__proxy__pb2.Packet.SerializeToString,
      ),
      'unaryCall': grpc.unary_unary_rpc_method_handler(
          servicer.unaryCall,
          request_deserializer=fate__proxy__pb2.Packet.FromString,
          response_serializer=fate__proxy__pb2.Packet.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.fate.api.networking.proxy.DataTransferService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
开发者ID:FederatedAI,项目名称:FATE,代码行数:23,代码来源:fate_proxy_pb2_grpc.py

示例15: add_LogFilesServiceServicer_to_server

# 需要导入模块: import grpc [as 别名]
# 或者: from grpc import unary_unary_rpc_method_handler [as 别名]
def add_LogFilesServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetEntries': grpc.unary_unary_rpc_method_handler(
                    servicer.GetEntries,
                    request_deserializer=log__files_dot_log__files__pb2.GetEntriesRequest.FromString,
                    response_serializer=log__files_dot_log__files__pb2.GetEntriesResponse.SerializeToString,
            ),
            'SubscribeDownloadLogFile': grpc.unary_stream_rpc_method_handler(
                    servicer.SubscribeDownloadLogFile,
                    request_deserializer=log__files_dot_log__files__pb2.SubscribeDownloadLogFileRequest.FromString,
                    response_serializer=log__files_dot_log__files__pb2.DownloadLogFileResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'mavsdk.rpc.log_files.LogFilesService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
开发者ID:mavlink,项目名称:MAVSDK-Python,代码行数:21,代码来源:log_files_pb2_grpc.py


注:本文中的grpc.unary_unary_rpc_method_handler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。