當前位置: 首頁>>代碼示例>>Python>>正文


Python grpc.method_handlers_generic_handler方法代碼示例

本文整理匯總了Python中grpc.method_handlers_generic_handler方法的典型用法代碼示例。如果您正苦於以下問題:Python grpc.method_handlers_generic_handler方法的具體用法?Python grpc.method_handlers_generic_handler怎麽用?Python grpc.method_handlers_generic_handler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在grpc的用法示例。


在下文中一共展示了grpc.method_handlers_generic_handler方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: add_QueryService_v1Servicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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 method_handlers_generic_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.method_handlers_generic_handler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。