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


Python grpc.stream_stream_rpc_method_handler方法代碼示例

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


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

示例1: add_pcoccNodeServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_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

示例2: add_RibApiServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_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

示例3: add_SpeechServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_SpeechServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Recognize': grpc.unary_unary_rpc_method_handler(
          servicer.Recognize,
          request_deserializer=speech__pb2.RecognizeRequest.FromString,
          response_serializer=speech__pb2.RecognizeResponse.SerializeToString,
      ),
      'StreamingRecognize': grpc.stream_stream_rpc_method_handler(
          servicer.StreamingRecognize,
          request_deserializer=speech__pb2.StreamingRecognizeRequest.FromString,
          response_serializer=speech__pb2.StreamingRecognizeResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'parlance.patter.speech.v1.Speech', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:ryanleary,項目名稱:patter,代碼行數:18,代碼來源:speech_pb2_grpc.py

示例4: add_ClusterServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_ClusterServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Submit': grpc.stream_stream_rpc_method_handler(
          servicer.Submit,
          request_deserializer=hfc_dot_protos_dot_orderer_dot_cluster__pb2.SubmitRequest.FromString,
          response_serializer=hfc_dot_protos_dot_orderer_dot_cluster__pb2.SubmitResponse.SerializeToString,
      ),
      'Step': grpc.unary_unary_rpc_method_handler(
          servicer.Step,
          request_deserializer=hfc_dot_protos_dot_orderer_dot_cluster__pb2.StepRequest.FromString,
          response_serializer=hfc_dot_protos_dot_orderer_dot_cluster__pb2.StepResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'orderer.Cluster', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:hyperledger,項目名稱:fabric-sdk-py,代碼行數:18,代碼來源:cluster_pb2_grpc.py

示例5: add_AtomicBroadcastServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_AtomicBroadcastServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Broadcast': grpc.stream_stream_rpc_method_handler(
          servicer.Broadcast,
          request_deserializer=hfc_dot_protos_dot_common_dot_common__pb2.Envelope.FromString,
          response_serializer=hfc_dot_protos_dot_orderer_dot_ab__pb2.BroadcastResponse.SerializeToString,
      ),
      'Deliver': grpc.stream_stream_rpc_method_handler(
          servicer.Deliver,
          request_deserializer=hfc_dot_protos_dot_common_dot_common__pb2.Envelope.FromString,
          response_serializer=hfc_dot_protos_dot_orderer_dot_ab__pb2.DeliverResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'orderer.AtomicBroadcast', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:hyperledger,項目名稱:fabric-sdk-py,代碼行數:18,代碼來源:ab_pb2_grpc.py

示例6: add_DeliverServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_DeliverServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Deliver': grpc.stream_stream_rpc_method_handler(
          servicer.Deliver,
          request_deserializer=hfc_dot_protos_dot_common_dot_common__pb2.Envelope.FromString,
          response_serializer=hfc_dot_protos_dot_peer_dot_events__pb2.DeliverResponse.SerializeToString,
      ),
      'DeliverFiltered': grpc.stream_stream_rpc_method_handler(
          servicer.DeliverFiltered,
          request_deserializer=hfc_dot_protos_dot_common_dot_common__pb2.Envelope.FromString,
          response_serializer=hfc_dot_protos_dot_peer_dot_events__pb2.DeliverResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'protos.Deliver', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:hyperledger,項目名稱:fabric-sdk-py,代碼行數:18,代碼來源:events_pb2_grpc.py

示例7: add_GossipServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_GossipServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GossipStream': grpc.stream_stream_rpc_method_handler(
          servicer.GossipStream,
          request_deserializer=hfc_dot_protos_dot_gossip_dot_message__pb2.Envelope.FromString,
          response_serializer=hfc_dot_protos_dot_gossip_dot_message__pb2.Envelope.SerializeToString,
      ),
      'Ping': grpc.unary_unary_rpc_method_handler(
          servicer.Ping,
          request_deserializer=hfc_dot_protos_dot_gossip_dot_message__pb2.Empty.FromString,
          response_serializer=hfc_dot_protos_dot_gossip_dot_message__pb2.Empty.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'gossip.Gossip', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:hyperledger,項目名稱:fabric-sdk-py,代碼行數:18,代碼來源:message_pb2_grpc.py

示例8: add_SubscriberServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_SubscriberServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'receive': grpc.unary_stream_rpc_method_handler(
            servicer.receive,
            request_deserializer=SubscriptionRequest.FromString,
            response_serializer=Message.SerializeToString,
        ),
        'receiveWithAcks': grpc.stream_stream_rpc_method_handler(
            servicer.receiveWithAcks,
            request_deserializer=SubscriptionResponse.FromString,
            response_serializer=Message.SerializeToString,
        ),
        'subscribe': grpc.stream_stream_rpc_method_handler(
            servicer.subscribe,
            request_deserializer=SubscriptionAcks.FromString,
            response_serializer=SubscriptionMessage.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'predix.eventhub.Subscriber', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:PredixDev,項目名稱:predixpy,代碼行數:23,代碼來源:EventHub_pb2.py

示例9: add_SubscriberServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_SubscriberServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'receive': grpc.unary_stream_rpc_method_handler(
          servicer.receive,
          request_deserializer=EventHub__pb2.SubscriptionRequest.FromString,
          response_serializer=EventHub__pb2.Message.SerializeToString,
      ),
      'receiveWithAcks': grpc.stream_stream_rpc_method_handler(
          servicer.receiveWithAcks,
          request_deserializer=EventHub__pb2.SubscriptionResponse.FromString,
          response_serializer=EventHub__pb2.Message.SerializeToString,
      ),
      'subscribe': grpc.stream_stream_rpc_method_handler(
          servicer.subscribe,
          request_deserializer=EventHub__pb2.SubscriptionAcks.FromString,
          response_serializer=EventHub__pb2.SubscriptionMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'predix.eventhub.Subscriber', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:PredixDev,項目名稱:predixpy,代碼行數:23,代碼來源:EventHub_pb2_grpc.py

示例10: add_ConnectorServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_ConnectorServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GetCapabilities': grpc.unary_unary_rpc_method_handler(
            servicer.GetCapabilities,
            request_deserializer=Empty.FromString,
            response_serializer=Capabilities.SerializeToString,
        ),
        'ExecuteFunction': grpc.stream_stream_rpc_method_handler(
            servicer.ExecuteFunction,
            request_deserializer=BundledRows.FromString,
            response_serializer=BundledRows.SerializeToString,
        ),
        'EvaluateScript': grpc.stream_stream_rpc_method_handler(
            servicer.EvaluateScript,
            request_deserializer=BundledRows.FromString,
            response_serializer=BundledRows.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'qlik.sse.Connector', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:nabeel-oz,項目名稱:qlik-py-tools,代碼行數:23,代碼來源:ServerSideExtension_pb2.py

示例11: add_SessionsServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_SessionsServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "DetectIntent": grpc.unary_unary_rpc_method_handler(
            servicer.DetectIntent,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_session__pb2.DetectIntentRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_session__pb2.DetectIntentResponse.SerializeToString,
        ),
        "StreamingDetectIntent": grpc.stream_stream_rpc_method_handler(
            servicer.StreamingDetectIntent,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_session__pb2.StreamingDetectIntentRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2beta1_dot_proto_dot_session__pb2.StreamingDetectIntentResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.dialogflow.v2beta1.Sessions", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:googleapis,項目名稱:dialogflow-python-client-v2,代碼行數:19,代碼來源:session_pb2_grpc.py

示例12: add_SessionsServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_SessionsServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "DetectIntent": grpc.unary_unary_rpc_method_handler(
            servicer.DetectIntent,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.DetectIntentRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.DetectIntentResponse.SerializeToString,
        ),
        "StreamingDetectIntent": grpc.stream_stream_rpc_method_handler(
            servicer.StreamingDetectIntent,
            request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.StreamingDetectIntentRequest.FromString,
            response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.StreamingDetectIntentResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.dialogflow.v2.Sessions", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:googleapis,項目名稱:dialogflow-python-client-v2,代碼行數:19,代碼來源:session_pb2_grpc.py

示例13: _wrap_rpc_behavior

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def _wrap_rpc_behavior(handler, fn):
    """Returns a new rpc handler that wraps the given function"""
    if handler is None:
        return None

    if handler.request_streaming and handler.response_streaming:
        behavior_fn = handler.stream_stream
        handler_factory = grpc.stream_stream_rpc_method_handler
    elif handler.request_streaming and not handler.response_streaming:
        behavior_fn = handler.stream_unary
        handler_factory = grpc.stream_unary_rpc_method_handler
    elif not handler.request_streaming and handler.response_streaming:
        behavior_fn = handler.unary_stream
        handler_factory = grpc.unary_stream_rpc_method_handler
    else:
        behavior_fn = handler.unary_unary
        handler_factory = grpc.unary_unary_rpc_method_handler

    return handler_factory(
        fn(behavior_fn, handler.request_streaming,
           handler.response_streaming),
        request_deserializer=handler.request_deserializer,
        response_serializer=handler.response_serializer
    ) 
開發者ID:census-instrumentation,項目名稱:opencensus-python,代碼行數:26,代碼來源:server_interceptor.py

示例14: add_TraceServiceServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_TraceServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Config': grpc.stream_stream_rpc_method_handler(
          servicer.Config,
          request_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.CurrentLibraryConfig.FromString,
          response_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.UpdatedLibraryConfig.SerializeToString,
      ),
      'Export': grpc.stream_stream_rpc_method_handler(
          servicer.Export,
          request_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceRequest.FromString,
          response_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'opencensus.proto.agent.trace.v1.TraceService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:census-instrumentation,項目名稱:opencensus-proto,代碼行數:18,代碼來源:trace_service_pb2_grpc.py

示例15: add_TransferServiceServicer_to_server

# 需要導入模塊: import grpc [as 別名]
# 或者: from grpc import stream_stream_rpc_method_handler [as 別名]
def add_TransferServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'send': grpc.stream_unary_rpc_method_handler(
          servicer.send,
          request_deserializer=transfer__pb2.TransferBatch.FromString,
          response_serializer=transfer__pb2.TransferBatch.SerializeToString,
      ),
      'recv': grpc.unary_stream_rpc_method_handler(
          servicer.recv,
          request_deserializer=transfer__pb2.TransferBatch.FromString,
          response_serializer=transfer__pb2.TransferBatch.SerializeToString,
      ),
      'sendRecv': grpc.stream_stream_rpc_method_handler(
          servicer.sendRecv,
          request_deserializer=transfer__pb2.TransferBatch.FromString,
          response_serializer=transfer__pb2.TransferBatch.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.eggroll.core.transfer.TransferService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
開發者ID:WeBankFinTech,項目名稱:eggroll,代碼行數:23,代碼來源:transfer_pb2_grpc.py


注:本文中的grpc.stream_stream_rpc_method_handler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。