Python grpc.unary_stream_rpc_method_handler() Examples

The following are 30 code examples of grpc.unary_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: google_ads_service_pb2_grpc.py    From google-ads-python with Apache License 2.0 6 votes vote down vote up
def add_GoogleAdsServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Search': grpc.unary_unary_rpc_method_handler(
          servicer.Search,
          request_deserializer=google_dot_ads_dot_googleads__v3_dot_proto_dot_services_dot_google__ads__service__pb2.SearchGoogleAdsRequest.FromString,
          response_serializer=google_dot_ads_dot_googleads__v3_dot_proto_dot_services_dot_google__ads__service__pb2.SearchGoogleAdsResponse.SerializeToString,
      ),
      'SearchStream': grpc.unary_stream_rpc_method_handler(
          servicer.SearchStream,
          request_deserializer=google_dot_ads_dot_googleads__v3_dot_proto_dot_services_dot_google__ads__service__pb2.SearchGoogleAdsStreamRequest.FromString,
          response_serializer=google_dot_ads_dot_googleads__v3_dot_proto_dot_services_dot_google__ads__service__pb2.SearchGoogleAdsStreamResponse.SerializeToString,
      ),
      'Mutate': grpc.unary_unary_rpc_method_handler(
          servicer.Mutate,
          request_deserializer=google_dot_ads_dot_googleads__v3_dot_proto_dot_services_dot_google__ads__service__pb2.MutateGoogleAdsRequest.FromString,
          response_serializer=google_dot_ads_dot_googleads__v3_dot_proto_dot_services_dot_google__ads__service__pb2.MutateGoogleAdsResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'google.ads.googleads.v3.services.GoogleAdsService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #2
Source File: WisdomGrpcService_pb2_grpc.py    From pcap-processor with GNU General Public License v3.0 6 votes vote down vote up
def add_WisdomServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'send': grpc.unary_unary_rpc_method_handler(
            servicer.send,
            request_deserializer=WisdomGrpcService__pb2.Event.FromString,
            response_serializer=WisdomGrpcService__pb2.Event.SerializeToString,
        ),
        'feed': grpc.stream_unary_rpc_method_handler(
            servicer.feed,
            request_deserializer=WisdomGrpcService__pb2.Event.FromString,
            response_serializer=WisdomGrpcService__pb2.Event.SerializeToString,
        ),
        'receive': grpc.unary_stream_rpc_method_handler(
            servicer.receive,
            request_deserializer=WisdomGrpcService__pb2.Event.FromString,
            response_serializer=WisdomGrpcService__pb2.Event.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'com.javahelps.wisdom.service.gprc.Wisdom', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #3
Source File: proxy_pb2_grpc.py    From eggroll with Apache License 2.0 6 votes vote down vote up
def add_DataTransferServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'push': grpc.stream_unary_rpc_method_handler(
          servicer.push,
          request_deserializer=proxy__pb2.Packet.FromString,
          response_serializer=proxy__pb2.Metadata.SerializeToString,
      ),
      'pull': grpc.unary_stream_rpc_method_handler(
          servicer.pull,
          request_deserializer=proxy__pb2.Metadata.FromString,
          response_serializer=proxy__pb2.Packet.SerializeToString,
      ),
      'unaryCall': grpc.unary_unary_rpc_method_handler(
          servicer.unaryCall,
          request_deserializer=proxy__pb2.Packet.FromString,
          response_serializer=proxy__pb2.Packet.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.eggroll.api.networking.proxy.DataTransferService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
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: proxy_pb2_grpc.py    From eggroll with Apache License 2.0 6 votes vote down vote up
def add_DataTransferServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'push': grpc.stream_unary_rpc_method_handler(
          servicer.push,
          request_deserializer=proxy__pb2.Packet.FromString,
          response_serializer=proxy__pb2.Metadata.SerializeToString,
      ),
      'pull': grpc.unary_stream_rpc_method_handler(
          servicer.pull,
          request_deserializer=proxy__pb2.Metadata.FromString,
          response_serializer=proxy__pb2.Packet.SerializeToString,
      ),
      'unaryCall': grpc.unary_unary_rpc_method_handler(
          servicer.unaryCall,
          request_deserializer=proxy__pb2.Packet.FromString,
          response_serializer=proxy__pb2.Packet.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.eggroll.api.networking.proxy.DataTransferService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #6
Source File: debug_pb2_grpc.py    From python-pachyderm with Apache License 2.0 6 votes vote down vote up
def add_DebugServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Dump': grpc.unary_stream_rpc_method_handler(
          servicer.Dump,
          request_deserializer=client_dot_debug_dot_debug__pb2.DumpRequest.FromString,
          response_serializer=google_dot_protobuf_dot_wrappers__pb2.BytesValue.SerializeToString,
      ),
      'Profile': grpc.unary_stream_rpc_method_handler(
          servicer.Profile,
          request_deserializer=client_dot_debug_dot_debug__pb2.ProfileRequest.FromString,
          response_serializer=google_dot_protobuf_dot_wrappers__pb2.BytesValue.SerializeToString,
      ),
      'Binary': grpc.unary_stream_rpc_method_handler(
          servicer.Binary,
          request_deserializer=client_dot_debug_dot_debug__pb2.BinaryRequest.FromString,
          response_serializer=google_dot_protobuf_dot_wrappers__pb2.BytesValue.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'debug.Debug', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #7
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 #8
Source File: grpc_endpoint_pb2_grpc.py    From dcos with Apache License 2.0 6 votes vote down vote up
def add_MockServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'UnaryDoSomething': grpc.unary_unary_rpc_method_handler(
          servicer.UnaryDoSomething,
          request_deserializer=mocker_dot_endpoints_dot_grpc__endpoint__pb2.StringMessage.FromString,
          response_serializer=mocker_dot_endpoints_dot_grpc__endpoint__pb2.StringMessage.SerializeToString,
      ),
      'ClientStreamDoSomething': grpc.stream_unary_rpc_method_handler(
          servicer.ClientStreamDoSomething,
          request_deserializer=mocker_dot_endpoints_dot_grpc__endpoint__pb2.IntMessage.FromString,
          response_serializer=mocker_dot_endpoints_dot_grpc__endpoint__pb2.IntCollectionMessage.SerializeToString,
      ),
      'ServerSteramDoSomething': grpc.unary_stream_rpc_method_handler(
          servicer.ServerSteramDoSomething,
          request_deserializer=mocker_dot_endpoints_dot_grpc__endpoint__pb2.IntCollectionMessage.FromString,
          response_serializer=mocker_dot_endpoints_dot_grpc__endpoint__pb2.IntMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'etcdserverpb.MockService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #9
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 #10
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 #11
Source File: core_pb2_grpc.py    From MAVSDK-Python with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def add_CoreServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SubscribeConnectionState': grpc.unary_stream_rpc_method_handler(
                    servicer.SubscribeConnectionState,
                    request_deserializer=core_dot_core__pb2.SubscribeConnectionStateRequest.FromString,
                    response_serializer=core_dot_core__pb2.ConnectionStateResponse.SerializeToString,
            ),
            'ListRunningPlugins': grpc.unary_unary_rpc_method_handler(
                    servicer.ListRunningPlugins,
                    request_deserializer=core_dot_core__pb2.ListRunningPluginsRequest.FromString,
                    response_serializer=core_dot_core__pb2.ListRunningPluginsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'mavsdk.rpc.core.CoreService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
Example #12
Source File: shell_pb2_grpc.py    From MAVSDK-Python with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def add_ShellServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Send': grpc.unary_unary_rpc_method_handler(
                    servicer.Send,
                    request_deserializer=shell_dot_shell__pb2.SendRequest.FromString,
                    response_serializer=shell_dot_shell__pb2.SendResponse.SerializeToString,
            ),
            'SubscribeReceive': grpc.unary_stream_rpc_method_handler(
                    servicer.SubscribeReceive,
                    request_deserializer=shell_dot_shell__pb2.SubscribeReceiveRequest.FromString,
                    response_serializer=shell_dot_shell__pb2.ReceiveResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'mavsdk.rpc.shell.ShellService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
Example #13
Source File: log_files_pb2_grpc.py    From MAVSDK-Python with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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. 
Example #14
Source File: proxy_pb2_grpc.py    From FATE with Apache License 2.0 6 votes vote down vote up
def add_DataTransferServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'push': grpc.stream_unary_rpc_method_handler(
          servicer.push,
          request_deserializer=proxy__pb2.Packet.FromString,
          response_serializer=proxy__pb2.Metadata.SerializeToString,
      ),
      'pull': grpc.unary_stream_rpc_method_handler(
          servicer.pull,
          request_deserializer=proxy__pb2.Metadata.FromString,
          response_serializer=proxy__pb2.Packet.SerializeToString,
      ),
      'unaryCall': grpc.unary_unary_rpc_method_handler(
          servicer.unaryCall,
          request_deserializer=proxy__pb2.Packet.FromString,
          response_serializer=proxy__pb2.Packet.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.eggroll.api.networking.proxy.DataTransferService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #15
Source File: endpoint_pb2_grpc.py    From iroha-python with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #16
Source File: fate_proxy_pb2_grpc.py    From FATE with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #17
Source File: clearly_pb2_grpc.py    From clearly with MIT License 5 votes vote down vote up
def add_ClearlyServerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'capture_realtime': grpc.unary_stream_rpc_method_handler(
          servicer.capture_realtime,
          request_deserializer=protos_dot_clearly__pb2.CaptureRequest.FromString,
          response_serializer=protos_dot_clearly__pb2.RealtimeMessage.SerializeToString,
      ),
      'filter_tasks': grpc.unary_stream_rpc_method_handler(
          servicer.filter_tasks,
          request_deserializer=protos_dot_clearly__pb2.FilterTasksRequest.FromString,
          response_serializer=protos_dot_clearly__pb2.TaskMessage.SerializeToString,
      ),
      'filter_workers': grpc.unary_stream_rpc_method_handler(
          servicer.filter_workers,
          request_deserializer=protos_dot_clearly__pb2.FilterWorkersRequest.FromString,
          response_serializer=protos_dot_clearly__pb2.WorkerMessage.SerializeToString,
      ),
      'seen_tasks': grpc.unary_unary_rpc_method_handler(
          servicer.seen_tasks,
          request_deserializer=protos_dot_clearly__pb2.Null.FromString,
          response_serializer=protos_dot_clearly__pb2.SeenTasksMessage.SerializeToString,
      ),
      'reset_tasks': grpc.unary_unary_rpc_method_handler(
          servicer.reset_tasks,
          request_deserializer=protos_dot_clearly__pb2.Null.FromString,
          response_serializer=protos_dot_clearly__pb2.Null.SerializeToString,
      ),
      'get_metrics': grpc.unary_unary_rpc_method_handler(
          servicer.get_metrics,
          request_deserializer=protos_dot_clearly__pb2.Null.FromString,
          response_serializer=protos_dot_clearly__pb2.StatsMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'ClearlyServer', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #18
Source File: loop_client_pb2_grpc.py    From lnd_grpc with MIT License 5 votes vote down vote up
def add_SwapClientServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'LoopOut': grpc.unary_unary_rpc_method_handler(
          servicer.LoopOut,
          request_deserializer=loop__rpc_dot_protos_dot_loop__client__pb2.LoopOutRequest.FromString,
          response_serializer=loop__rpc_dot_protos_dot_loop__client__pb2.SwapResponse.SerializeToString,
      ),
      'LoopIn': grpc.unary_unary_rpc_method_handler(
          servicer.LoopIn,
          request_deserializer=loop__rpc_dot_protos_dot_loop__client__pb2.LoopInRequest.FromString,
          response_serializer=loop__rpc_dot_protos_dot_loop__client__pb2.SwapResponse.SerializeToString,
      ),
      'Monitor': grpc.unary_stream_rpc_method_handler(
          servicer.Monitor,
          request_deserializer=loop__rpc_dot_protos_dot_loop__client__pb2.MonitorRequest.FromString,
          response_serializer=loop__rpc_dot_protos_dot_loop__client__pb2.SwapStatus.SerializeToString,
      ),
      'LoopOutTerms': grpc.unary_unary_rpc_method_handler(
          servicer.LoopOutTerms,
          request_deserializer=loop__rpc_dot_protos_dot_loop__client__pb2.TermsRequest.FromString,
          response_serializer=loop__rpc_dot_protos_dot_loop__client__pb2.TermsResponse.SerializeToString,
      ),
      'LoopOutQuote': grpc.unary_unary_rpc_method_handler(
          servicer.LoopOutQuote,
          request_deserializer=loop__rpc_dot_protos_dot_loop__client__pb2.QuoteRequest.FromString,
          response_serializer=loop__rpc_dot_protos_dot_loop__client__pb2.QuoteResponse.SerializeToString,
      ),
      'GetLoopInTerms': grpc.unary_unary_rpc_method_handler(
          servicer.GetLoopInTerms,
          request_deserializer=loop__rpc_dot_protos_dot_loop__client__pb2.TermsRequest.FromString,
          response_serializer=loop__rpc_dot_protos_dot_loop__client__pb2.TermsResponse.SerializeToString,
      ),
      'GetLoopInQuote': grpc.unary_unary_rpc_method_handler(
          servicer.GetLoopInQuote,
          request_deserializer=loop__rpc_dot_protos_dot_loop__client__pb2.QuoteRequest.FromString,
          response_serializer=loop__rpc_dot_protos_dot_loop__client__pb2.QuoteResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'looprpc.SwapClient', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #19
Source File: rpc_pb2_grpc.py    From python-etcd3 with Apache License 2.0 5 votes vote down vote up
def add_MaintenanceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Alarm': grpc.unary_unary_rpc_method_handler(
          servicer.Alarm,
          request_deserializer=rpc__pb2.AlarmRequest.FromString,
          response_serializer=rpc__pb2.AlarmResponse.SerializeToString,
      ),
      'Status': grpc.unary_unary_rpc_method_handler(
          servicer.Status,
          request_deserializer=rpc__pb2.StatusRequest.FromString,
          response_serializer=rpc__pb2.StatusResponse.SerializeToString,
      ),
      'Defragment': grpc.unary_unary_rpc_method_handler(
          servicer.Defragment,
          request_deserializer=rpc__pb2.DefragmentRequest.FromString,
          response_serializer=rpc__pb2.DefragmentResponse.SerializeToString,
      ),
      'Hash': grpc.unary_unary_rpc_method_handler(
          servicer.Hash,
          request_deserializer=rpc__pb2.HashRequest.FromString,
          response_serializer=rpc__pb2.HashResponse.SerializeToString,
      ),
      'HashKV': grpc.unary_unary_rpc_method_handler(
          servicer.HashKV,
          request_deserializer=rpc__pb2.HashKVRequest.FromString,
          response_serializer=rpc__pb2.HashKVResponse.SerializeToString,
      ),
      'Snapshot': grpc.unary_stream_rpc_method_handler(
          servicer.Snapshot,
          request_deserializer=rpc__pb2.SnapshotRequest.FromString,
          response_serializer=rpc__pb2.SnapshotResponse.SerializeToString,
      ),
      'MoveLeader': grpc.unary_unary_rpc_method_handler(
          servicer.MoveLeader,
          request_deserializer=rpc__pb2.MoveLeaderRequest.FromString,
          response_serializer=rpc__pb2.MoveLeaderResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'etcdserverpb.Maintenance', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #20
Source File: endpoint_pb2_grpc.py    From iroha-python with Apache License 2.0 5 votes vote down vote up
def add_CommandService_v1Servicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Torii': grpc.unary_unary_rpc_method_handler(
          servicer.Torii,
          request_deserializer=transaction__pb2.Transaction.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'ListTorii': grpc.unary_unary_rpc_method_handler(
          servicer.ListTorii,
          request_deserializer=endpoint__pb2.TxList.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'Status': grpc.unary_unary_rpc_method_handler(
          servicer.Status,
          request_deserializer=endpoint__pb2.TxStatusRequest.FromString,
          response_serializer=endpoint__pb2.ToriiResponse.SerializeToString,
      ),
      'StatusStream': grpc.unary_stream_rpc_method_handler(
          servicer.StatusStream,
          request_deserializer=endpoint__pb2.TxStatusRequest.FromString,
          response_serializer=endpoint__pb2.ToriiResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'iroha.protocol.CommandService_v1', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #21
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 #22
Source File: admin_pb2_grpc.py    From python-pachyderm with Apache License 2.0 5 votes vote down vote up
def add_APIServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Extract': grpc.unary_stream_rpc_method_handler(
          servicer.Extract,
          request_deserializer=client_dot_admin_dot_admin__pb2.ExtractRequest.FromString,
          response_serializer=client_dot_admin_dot_admin__pb2.Op.SerializeToString,
      ),
      'ExtractPipeline': grpc.unary_unary_rpc_method_handler(
          servicer.ExtractPipeline,
          request_deserializer=client_dot_admin_dot_admin__pb2.ExtractPipelineRequest.FromString,
          response_serializer=client_dot_admin_dot_admin__pb2.Op.SerializeToString,
      ),
      'Restore': grpc.stream_unary_rpc_method_handler(
          servicer.Restore,
          request_deserializer=client_dot_admin_dot_admin__pb2.RestoreRequest.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'InspectCluster': grpc.unary_unary_rpc_method_handler(
          servicer.InspectCluster,
          request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
          response_serializer=client_dot_admin_dot_admin__pb2.ClusterInfo.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'admin.API', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #23
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 #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: router_pb2_grpc.py    From python-app-sdk with MIT License 5 votes vote down vote up
def add_RouterServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GatewayStatus': grpc.stream_unary_rpc_method_handler(
          servicer.GatewayStatus,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_gateway_dot_gateway__pb2.Status.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'Uplink': grpc.stream_unary_rpc_method_handler(
          servicer.Uplink,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.UplinkMessage.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'Subscribe': grpc.unary_stream_rpc_method_handler(
          servicer.Subscribe,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.SubscribeRequest.FromString,
          response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.DownlinkMessage.SerializeToString,
      ),
      'Activate': grpc.unary_unary_rpc_method_handler(
          servicer.Activate,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.DeviceActivationRequest.FromString,
          response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.DeviceActivationResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'router.Router', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #27
Source File: router_pb2.py    From python-app-sdk with MIT License 5 votes vote down vote up
def add_RouterServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GatewayStatus': grpc.stream_unary_rpc_method_handler(
            servicer.GatewayStatus,
            request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_gateway_dot_gateway__pb2.Status.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        'Uplink': grpc.stream_unary_rpc_method_handler(
            servicer.Uplink,
            request_deserializer=UplinkMessage.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        'Subscribe': grpc.unary_stream_rpc_method_handler(
            servicer.Subscribe,
            request_deserializer=SubscribeRequest.FromString,
            response_serializer=DownlinkMessage.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(
        'router.Router', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #28
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,)) 
Example #29
Source File: broker_pb2_grpc.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=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.UplinkMessage.FromString,
          response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DownlinkMessage.SerializeToString,
      ),
      'Subscribe': grpc.unary_stream_rpc_method_handler(
          servicer.Subscribe,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.SubscribeRequest.FromString,
          response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeduplicatedUplinkMessage.SerializeToString,
      ),
      'Publish': grpc.stream_unary_rpc_method_handler(
          servicer.Publish,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DownlinkMessage.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'Activate': grpc.unary_unary_rpc_method_handler(
          servicer.Activate,
          request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeviceActivationRequest.FromString,
          response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeviceActivationResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'broker.Broker', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example #30
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,))