Python grpc.stream_stream_rpc_method_handler() Examples

The following are 30 code examples of grpc.stream_stream_rpc_method_handler(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module grpc , or try the search function .
Example #1
Source File: events_pb2_grpc.py    From fabric-sdk-py with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #2
Source File: cloud_speech_pb2_grpc.py    From python-speech with Apache License 2.0 6 votes vote down vote up
def add_SpeechServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Recognize": grpc.unary_unary_rpc_method_handler(
            servicer.Recognize,
            request_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.RecognizeRequest.FromString,
            response_serializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.RecognizeResponse.SerializeToString,
        ),
        "LongRunningRecognize": grpc.unary_unary_rpc_method_handler(
            servicer.LongRunningRecognize,
            request_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.LongRunningRecognizeRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "StreamingRecognize": grpc.stream_stream_rpc_method_handler(
            servicer.StreamingRecognize,
            request_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeRequest.FromString,
            response_serializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.speech.v1p1beta1.Speech", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API. 
Example #3
Source File: cloud_speech_pb2_grpc.py    From python-speech with Apache License 2.0 6 votes vote down vote up
def add_SpeechServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "Recognize": grpc.unary_unary_rpc_method_handler(
            servicer.Recognize,
            request_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.RecognizeRequest.FromString,
            response_serializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.RecognizeResponse.SerializeToString,
        ),
        "LongRunningRecognize": grpc.unary_unary_rpc_method_handler(
            servicer.LongRunningRecognize,
            request_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.LongRunningRecognizeRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "StreamingRecognize": grpc.stream_stream_rpc_method_handler(
            servicer.StreamingRecognize,
            request_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeRequest.FromString,
            response_serializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.speech.v1.Speech", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API. 
Example #4
Source File: transfer_pb2_grpc.py    From eggroll with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #5
Source File: trace_service_pb2_grpc.py    From opencensus-proto with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #6
Source File: server_interceptor.py    From opencensus-python with Apache License 2.0 6 votes vote down vote up
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
    ) 
Example #7
Source File: session_pb2_grpc.py    From dialogflow-python-client-v2 with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #8
Source File: session_pb2_grpc.py    From dialogflow-python-client-v2 with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #9
Source File: ServerSideExtension_pb2.py    From qlik-py-tools with MIT License 6 votes vote down vote up
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,)) 
Example #10
Source File: EventHub_pb2_grpc.py    From predixpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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,)) 
Example #11
Source File: EventHub_pb2.py    From predixpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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,)) 
Example #12
Source File: message_pb2_grpc.py    From fabric-sdk-py with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #13
Source File: agent_pb2_grpc.py    From pcocc with GNU General Public License v3.0 6 votes vote down vote up
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,)) 
Example #14
Source File: ab_pb2_grpc.py    From fabric-sdk-py with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #15
Source File: cluster_pb2_grpc.py    From fabric-sdk-py with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #16
Source File: speech_pb2_grpc.py    From patter with MIT License 6 votes vote down vote up
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,)) 
Example #17
Source File: nokia_rib_api_pb2_grpc.py    From SROS-grpc-services with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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,)) 
Example #18
Source File: cert_pb2_grpc.py    From SROS-grpc-services with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def add_CertificateManagementServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Rotate': grpc.stream_stream_rpc_method_handler(
          servicer.Rotate,
          request_deserializer=cert__pb2.RotateCertificateRequest.FromString,
          response_serializer=cert__pb2.RotateCertificateResponse.SerializeToString,
      ),
      'Install': grpc.stream_stream_rpc_method_handler(
          servicer.Install,
          request_deserializer=cert__pb2.InstallCertificateRequest.FromString,
          response_serializer=cert__pb2.InstallCertificateResponse.SerializeToString,
      ),
      'GetCertificates': grpc.unary_unary_rpc_method_handler(
          servicer.GetCertificates,
          request_deserializer=cert__pb2.GetCertificatesRequest.FromString,
          response_serializer=cert__pb2.GetCertificatesResponse.SerializeToString,
      ),
      'RevokeCertificates': grpc.unary_unary_rpc_method_handler(
          servicer.RevokeCertificates,
          request_deserializer=cert__pb2.RevokeCertificatesRequest.FromString,
          response_serializer=cert__pb2.RevokeCertificatesResponse.SerializeToString,
      ),
      'CanGenerateCSR': grpc.unary_unary_rpc_method_handler(
          servicer.CanGenerateCSR,
          request_deserializer=cert__pb2.CanGenerateCSRRequest.FromString,
          response_serializer=cert__pb2.CanGenerateCSRResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'gnoi.certificate.CertificateManagement', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #19
Source File: gigagenieRPC_pb2_grpc.py    From ai-makers-kit with MIT License 5 votes vote down vote up
def add_GigagenieServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'getVoice2Text': grpc.stream_stream_rpc_method_handler(
          servicer.getVoice2Text,
          request_deserializer=gigagenieRPC__pb2.reqVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resText.SerializeToString,
      ),
      'getText2VoiceUrl': grpc.unary_unary_rpc_method_handler(
          servicer.getText2VoiceUrl,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resUrl.SerializeToString,
      ),
      'getText2VoiceStream': grpc.unary_stream_rpc_method_handler(
          servicer.getText2VoiceStream,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resVoice.SerializeToString,
      ),
      'queryByText': grpc.unary_unary_rpc_method_handler(
          servicer.queryByText,
          request_deserializer=gigagenieRPC__pb2.reqQueryText.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
      'queryByVoice': grpc.stream_unary_rpc_method_handler(
          servicer.queryByVoice,
          request_deserializer=gigagenieRPC__pb2.reqQueryVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'kt.gigagenie.ai.speech.Gigagenie', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #20
Source File: gigagenieRPC_pb2_grpc.py    From ai-makers-kit with MIT License 5 votes vote down vote up
def add_GigagenieServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'getVoice2Text': grpc.stream_stream_rpc_method_handler(
          servicer.getVoice2Text,
          request_deserializer=gigagenieRPC__pb2.reqVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resText.SerializeToString,
      ),
      'getText2VoiceUrl': grpc.unary_unary_rpc_method_handler(
          servicer.getText2VoiceUrl,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resUrl.SerializeToString,
      ),
      'getText2VoiceStream': grpc.unary_stream_rpc_method_handler(
          servicer.getText2VoiceStream,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resVoice.SerializeToString,
      ),
      'queryByText': grpc.unary_unary_rpc_method_handler(
          servicer.queryByText,
          request_deserializer=gigagenieRPC__pb2.reqQueryText.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
      'queryByVoice': grpc.stream_unary_rpc_method_handler(
          servicer.queryByVoice,
          request_deserializer=gigagenieRPC__pb2.reqQueryVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'kt.gigagenie.ai.speech.Gigagenie', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #21
Source File: debug_service_pb2_grpc.py    From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License 5 votes vote down vote up
def add_EventListenerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SendEvents': grpc.stream_stream_rpc_method_handler(
          servicer.SendEvents,
          request_deserializer=tensorflow_dot_core_dot_util_dot_event__pb2.Event.FromString,
          response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'tensorflow.EventListener', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #22
Source File: rpc_pb2_grpc.py    From python-etcd3 with Apache License 2.0 5 votes vote down vote up
def add_LeaseServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'LeaseGrant': grpc.unary_unary_rpc_method_handler(
          servicer.LeaseGrant,
          request_deserializer=rpc__pb2.LeaseGrantRequest.FromString,
          response_serializer=rpc__pb2.LeaseGrantResponse.SerializeToString,
      ),
      'LeaseRevoke': grpc.unary_unary_rpc_method_handler(
          servicer.LeaseRevoke,
          request_deserializer=rpc__pb2.LeaseRevokeRequest.FromString,
          response_serializer=rpc__pb2.LeaseRevokeResponse.SerializeToString,
      ),
      'LeaseKeepAlive': grpc.stream_stream_rpc_method_handler(
          servicer.LeaseKeepAlive,
          request_deserializer=rpc__pb2.LeaseKeepAliveRequest.FromString,
          response_serializer=rpc__pb2.LeaseKeepAliveResponse.SerializeToString,
      ),
      'LeaseTimeToLive': grpc.unary_unary_rpc_method_handler(
          servicer.LeaseTimeToLive,
          request_deserializer=rpc__pb2.LeaseTimeToLiveRequest.FromString,
          response_serializer=rpc__pb2.LeaseTimeToLiveResponse.SerializeToString,
      ),
      'LeaseLeases': grpc.unary_unary_rpc_method_handler(
          servicer.LeaseLeases,
          request_deserializer=rpc__pb2.LeaseLeasesRequest.FromString,
          response_serializer=rpc__pb2.LeaseLeasesResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'etcdserverpb.Lease', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #23
Source File: rpc_pb2_grpc.py    From python-etcd3 with Apache License 2.0 5 votes vote down vote up
def add_WatchServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Watch': grpc.stream_stream_rpc_method_handler(
          servicer.Watch,
          request_deserializer=rpc__pb2.WatchRequest.FromString,
          response_serializer=rpc__pb2.WatchResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'etcdserverpb.Watch', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #24
Source File: gigagenieRPC_pb2_grpc.py    From ai-makers-kit with MIT License 5 votes vote down vote up
def add_GigagenieServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'getVoice2Text': grpc.stream_stream_rpc_method_handler(
          servicer.getVoice2Text,
          request_deserializer=gigagenieRPC__pb2.reqVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resText.SerializeToString,
      ),
      'getText2VoiceUrl': grpc.unary_unary_rpc_method_handler(
          servicer.getText2VoiceUrl,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resUrl.SerializeToString,
      ),
      'getText2VoiceStream': grpc.unary_stream_rpc_method_handler(
          servicer.getText2VoiceStream,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resVoice.SerializeToString,
      ),
      'queryByText': grpc.unary_unary_rpc_method_handler(
          servicer.queryByText,
          request_deserializer=gigagenieRPC__pb2.reqQueryText.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
      'queryByVoice': grpc.stream_unary_rpc_method_handler(
          servicer.queryByVoice,
          request_deserializer=gigagenieRPC__pb2.reqQueryVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'kt.gigagenie.ai.speech.Gigagenie', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #25
Source File: gigagenieRPC_pb2_grpc.py    From ai-makers-kit with MIT License 5 votes vote down vote up
def add_GigagenieServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'getVoice2Text': grpc.stream_stream_rpc_method_handler(
          servicer.getVoice2Text,
          request_deserializer=gigagenieRPC__pb2.reqVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resText.SerializeToString,
      ),
      'getText2VoiceUrl': grpc.unary_unary_rpc_method_handler(
          servicer.getText2VoiceUrl,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resUrl.SerializeToString,
      ),
      'getText2VoiceStream': grpc.unary_stream_rpc_method_handler(
          servicer.getText2VoiceStream,
          request_deserializer=gigagenieRPC__pb2.reqText.FromString,
          response_serializer=gigagenieRPC__pb2.resVoice.SerializeToString,
      ),
      'queryByText': grpc.unary_unary_rpc_method_handler(
          servicer.queryByText,
          request_deserializer=gigagenieRPC__pb2.reqQueryText.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
      'queryByVoice': grpc.stream_unary_rpc_method_handler(
          servicer.queryByVoice,
          request_deserializer=gigagenieRPC__pb2.reqQueryVoice.FromString,
          response_serializer=gigagenieRPC__pb2.resQueryText.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'kt.gigagenie.ai.speech.Gigagenie', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #26
Source File: metrics_service_pb2_grpc.py    From opencensus-proto with Apache License 2.0 5 votes vote down vote up
def add_MetricsServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Export': grpc.stream_stream_rpc_method_handler(
          servicer.Export,
          request_deserializer=opencensus_dot_proto_dot_agent_dot_metrics_dot_v1_dot_metrics__service__pb2.ExportMetricsServiceRequest.FromString,
          response_serializer=opencensus_dot_proto_dot_agent_dot_metrics_dot_v1_dot_metrics__service__pb2.ExportMetricsServiceResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'opencensus.proto.agent.metrics.v1.MetricsService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #27
Source File: greeter_pb2_grpc.py    From purerpc with Apache License 2.0 5 votes vote down vote up
def add_GreeterServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SayHello': grpc.unary_unary_rpc_method_handler(
          servicer.SayHello,
          request_deserializer=generated_dot_greeter__pb2.HelloRequest.FromString,
          response_serializer=generated_dot_greeter__pb2.HelloReply.SerializeToString,
      ),
      'SayHelloGoodbye': grpc.unary_stream_rpc_method_handler(
          servicer.SayHelloGoodbye,
          request_deserializer=generated_dot_greeter__pb2.HelloRequest.FromString,
          response_serializer=generated_dot_greeter__pb2.HelloReply.SerializeToString,
      ),
      'SayHelloToMany': grpc.stream_stream_rpc_method_handler(
          servicer.SayHelloToMany,
          request_deserializer=generated_dot_greeter__pb2.HelloRequest.FromString,
          response_serializer=generated_dot_greeter__pb2.HelloReply.SerializeToString,
      ),
      'SayHelloToManyAtOnce': grpc.stream_unary_rpc_method_handler(
          servicer.SayHelloToManyAtOnce,
          request_deserializer=generated_dot_greeter__pb2.HelloRequest.FromString,
          response_serializer=generated_dot_greeter__pb2.HelloReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Greeter', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #28
Source File: embedded_assistant_pb2_grpc.py    From assistant-sdk-python with Apache License 2.0 5 votes vote down vote up
def add_EmbeddedAssistantServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Assist': grpc.stream_stream_rpc_method_handler(
          servicer.Assist,
          request_deserializer=google_dot_assistant_dot_embedded_dot_v1alpha2_dot_embedded__assistant__pb2.AssistRequest.FromString,
          response_serializer=google_dot_assistant_dot_embedded_dot_v1alpha2_dot_embedded__assistant__pb2.AssistResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'google.assistant.embedded.v1alpha2.EmbeddedAssistant', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #29
Source File: embedded_assistant_pb2_grpc.py    From assistant-sdk-python with Apache License 2.0 5 votes vote down vote up
def add_EmbeddedAssistantServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Converse': grpc.stream_stream_rpc_method_handler(
          servicer.Converse,
          request_deserializer=google_dot_assistant_dot_embedded_dot_v1alpha1_dot_embedded__assistant__pb2.ConverseRequest.FromString,
          response_serializer=google_dot_assistant_dot_embedded_dot_v1alpha1_dot_embedded__assistant__pb2.ConverseResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'google.assistant.embedded.v1alpha1.EmbeddedAssistant', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #30
Source File: broker_pb2.py    From python-app-sdk with MIT License 5 votes vote down vote up
def add_BrokerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Associate': grpc.stream_stream_rpc_method_handler(
            servicer.Associate,
            request_deserializer=UplinkMessage.FromString,
            response_serializer=DownlinkMessage.SerializeToString,
        ),
        'Subscribe': grpc.unary_stream_rpc_method_handler(
            servicer.Subscribe,
            request_deserializer=SubscribeRequest.FromString,
            response_serializer=DeduplicatedUplinkMessage.SerializeToString,
        ),
        'Publish': grpc.stream_unary_rpc_method_handler(
            servicer.Publish,
            request_deserializer=DownlinkMessage.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        'Activate': grpc.unary_unary_rpc_method_handler(
            servicer.Activate,
            request_deserializer=DeviceActivationRequest.FromString,
            response_serializer=DeviceActivationResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'broker.Broker', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))