Python grpc.stream_unary_rpc_method_handler() Examples
The following are 28
code examples of grpc.stream_unary_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: WisdomGrpcService_pb2_grpc.py From pcap-processor with GNU General Public License v3.0 | 6 votes |
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 #2
Source File: grpc_test_pb2_grpc.py From eggroll with Apache License 2.0 | 6 votes |
def add_HelloServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'unaryCall': grpc.unary_unary_rpc_method_handler( servicer.unaryCall, request_deserializer=grpc__test__pb2.HelloRequest.FromString, response_serializer=grpc__test__pb2.HelloResponse.SerializeToString, ), 'push': grpc.stream_unary_rpc_method_handler( servicer.push, request_deserializer=grpc__test__pb2.HelloRequest.FromString, response_serializer=grpc__test__pb2.HelloResponse.SerializeToString, ), 'pull': grpc.unary_unary_rpc_method_handler( servicer.pull, request_deserializer=grpc__test__pb2.HelloRequest.FromString, response_serializer=grpc__test__pb2.HelloResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'com.webank.eggroll.grpc.test.HelloService', 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 |
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 |
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 |
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: fate_proxy_pb2_grpc.py From FATE with Apache License 2.0 | 6 votes |
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 #7
Source File: proxy_pb2_grpc.py From FATE with Apache License 2.0 | 6 votes |
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 #8
Source File: server_interceptor.py From opencensus-python with Apache License 2.0 | 6 votes |
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 #9
Source File: grpc_endpoint_pb2_grpc.py From dcos with Apache License 2.0 | 6 votes |
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 #10
Source File: route_guide_pb2_grpc.py From opentelemetry-python with Apache License 2.0 | 5 votes |
def add_RouteGuideServicer_to_server(servicer, server): rpc_method_handlers = { 'GetFeature': grpc.unary_unary_rpc_method_handler( servicer.GetFeature, request_deserializer=route__guide__pb2.Point.FromString, response_serializer=route__guide__pb2.Feature.SerializeToString, ), 'ListFeatures': grpc.unary_stream_rpc_method_handler( servicer.ListFeatures, request_deserializer=route__guide__pb2.Rectangle.FromString, response_serializer=route__guide__pb2.Feature.SerializeToString, ), 'RecordRoute': grpc.stream_unary_rpc_method_handler( servicer.RecordRoute, request_deserializer=route__guide__pb2.Point.FromString, response_serializer=route__guide__pb2.RouteSummary.SerializeToString, ), 'RouteChat': grpc.stream_stream_rpc_method_handler( servicer.RouteChat, request_deserializer=route__guide__pb2.RouteNote.FromString, response_serializer=route__guide__pb2.RouteNote.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'routeguide.RouteGuide', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #11
Source File: admin_pb2_grpc.py From python-pachyderm with Apache License 2.0 | 5 votes |
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 #12
Source File: router_pb2.py From python-app-sdk with MIT License | 5 votes |
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 #13
Source File: broker_pb2.py From python-app-sdk with MIT License | 5 votes |
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 #14
Source File: broker_pb2_grpc.py From python-app-sdk with MIT License | 5 votes |
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 #15
Source File: gigagenieRPC_pb2_grpc.py From ai-makers-kit with MIT License | 5 votes |
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 #16
Source File: store_pb2_grpc.py From python-grpc with Apache License 2.0 | 5 votes |
def add_StoreServicer_to_server(servicer, server): rpc_method_handlers = { 'AddItem': grpc.unary_unary_rpc_method_handler( servicer.AddItem, request_deserializer=store__pb2.AddItemRequest.FromString, response_serializer=store__pb2.Empty.SerializeToString, ), 'AddItems': grpc.stream_unary_rpc_method_handler( servicer.AddItems, request_deserializer=store__pb2.AddItemRequest.FromString, response_serializer=store__pb2.Empty.SerializeToString, ), 'RemoveItem': grpc.unary_unary_rpc_method_handler( servicer.RemoveItem, request_deserializer=store__pb2.RemoveItemRequest.FromString, response_serializer=store__pb2.RemoveItemResponse.SerializeToString, ), 'RemoveItems': grpc.stream_unary_rpc_method_handler( servicer.RemoveItems, request_deserializer=store__pb2.RemoveItemRequest.FromString, response_serializer=store__pb2.RemoveItemResponse.SerializeToString, ), 'ListInventory': grpc.unary_stream_rpc_method_handler( servicer.ListInventory, request_deserializer=store__pb2.Empty.FromString, response_serializer=store__pb2.QuantityResponse.SerializeToString, ), 'QueryQuantity': grpc.unary_unary_rpc_method_handler( servicer.QueryQuantity, request_deserializer=store__pb2.QueryItemRequest.FromString, response_serializer=store__pb2.QuantityResponse.SerializeToString, ), 'QueryQuantities': grpc.stream_stream_rpc_method_handler( servicer.QueryQuantities, request_deserializer=store__pb2.QueryItemRequest.FromString, response_serializer=store__pb2.QuantityResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'store.Store', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #17
Source File: store_pb2.py From python-grpc with Apache License 2.0 | 5 votes |
def add_StoreServicer_to_server(servicer, server): rpc_method_handlers = { 'AddItem': grpc.unary_unary_rpc_method_handler( servicer.AddItem, request_deserializer=AddItemRequest.FromString, response_serializer=Empty.SerializeToString, ), 'AddItems': grpc.stream_unary_rpc_method_handler( servicer.AddItems, request_deserializer=AddItemRequest.FromString, response_serializer=Empty.SerializeToString, ), 'RemoveItem': grpc.unary_unary_rpc_method_handler( servicer.RemoveItem, request_deserializer=RemoveItemRequest.FromString, response_serializer=RemoveItemResponse.SerializeToString, ), 'RemoveItems': grpc.stream_unary_rpc_method_handler( servicer.RemoveItems, request_deserializer=RemoveItemRequest.FromString, response_serializer=RemoveItemResponse.SerializeToString, ), 'ListInventory': grpc.unary_stream_rpc_method_handler( servicer.ListInventory, request_deserializer=Empty.FromString, response_serializer=QuantityResponse.SerializeToString, ), 'QueryQuantity': grpc.unary_unary_rpc_method_handler( servicer.QueryQuantity, request_deserializer=QueryItemRequest.FromString, response_serializer=QuantityResponse.SerializeToString, ), 'QueryQuantities': grpc.stream_stream_rpc_method_handler( servicer.QueryQuantities, request_deserializer=QueryItemRequest.FromString, response_serializer=QuantityResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'store.Store', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #18
Source File: service_pb2.py From aiogrpc with Apache License 2.0 | 5 votes |
def add_TestServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'NormalMethod': grpc.unary_unary_rpc_method_handler( servicer.NormalMethod, request_deserializer=StandardRequest.FromString, response_serializer=StandardReply.SerializeToString, ), 'StreamMethod': grpc.unary_stream_rpc_method_handler( servicer.StreamMethod, request_deserializer=StreamRequest.FromString, response_serializer=StandardReply.SerializeToString, ), 'StreamInputMethod': grpc.stream_unary_rpc_method_handler( servicer.StreamInputMethod, request_deserializer=StandardRequest.FromString, response_serializer=StreamReply.SerializeToString, ), 'StreamStreamMethod': grpc.stream_stream_rpc_method_handler( servicer.StreamStreamMethod, request_deserializer=StandardRequest.FromString, response_serializer=StandardReply.SerializeToString, ), 'DelayedMethod': grpc.unary_unary_rpc_method_handler( servicer.DelayedMethod, request_deserializer=StandardRequest.FromString, response_serializer=StandardReply.SerializeToString, ), 'ExceptionMethod': grpc.unary_unary_rpc_method_handler( servicer.ExceptionMethod, request_deserializer=StandardRequest.FromString, response_serializer=StandardReply.SerializeToString, ), 'DelayedStream': grpc.unary_stream_rpc_method_handler( servicer.DelayedStream, request_deserializer=StreamRequest.FromString, response_serializer=StandardReply.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'TestService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #19
Source File: service_pb2_grpc.py From aiogrpc with Apache License 2.0 | 5 votes |
def add_TestServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'NormalMethod': grpc.unary_unary_rpc_method_handler( servicer.NormalMethod, request_deserializer=service__pb2.StandardRequest.FromString, response_serializer=service__pb2.StandardReply.SerializeToString, ), 'StreamMethod': grpc.unary_stream_rpc_method_handler( servicer.StreamMethod, request_deserializer=service__pb2.StreamRequest.FromString, response_serializer=service__pb2.StandardReply.SerializeToString, ), 'StreamInputMethod': grpc.stream_unary_rpc_method_handler( servicer.StreamInputMethod, request_deserializer=service__pb2.StandardRequest.FromString, response_serializer=service__pb2.StreamReply.SerializeToString, ), 'StreamStreamMethod': grpc.stream_stream_rpc_method_handler( servicer.StreamStreamMethod, request_deserializer=service__pb2.StandardRequest.FromString, response_serializer=service__pb2.StandardReply.SerializeToString, ), 'DelayedMethod': grpc.unary_unary_rpc_method_handler( servicer.DelayedMethod, request_deserializer=service__pb2.StandardRequest.FromString, response_serializer=service__pb2.StandardReply.SerializeToString, ), 'ExceptionMethod': grpc.unary_unary_rpc_method_handler( servicer.ExceptionMethod, request_deserializer=service__pb2.StandardRequest.FromString, response_serializer=service__pb2.StandardReply.SerializeToString, ), 'DelayedStream': grpc.unary_stream_rpc_method_handler( servicer.DelayedStream, request_deserializer=service__pb2.StreamRequest.FromString, response_serializer=service__pb2.StandardReply.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'TestService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #20
Source File: stan_pb2_grpc.py From python-sensor with MIT License | 5 votes |
def add_StanServicer_to_server(servicer, server): rpc_method_handlers = { 'OneQuestionOneResponse': grpc.unary_unary_rpc_method_handler( servicer.OneQuestionOneResponse, request_deserializer=stan__pb2.QuestionRequest.FromString, response_serializer=stan__pb2.QuestionResponse.SerializeToString, ), 'ManyQuestionsOneResponse': grpc.stream_unary_rpc_method_handler( servicer.ManyQuestionsOneResponse, request_deserializer=stan__pb2.QuestionRequest.FromString, response_serializer=stan__pb2.QuestionResponse.SerializeToString, ), 'OneQuestionManyResponses': grpc.unary_stream_rpc_method_handler( servicer.OneQuestionManyResponses, request_deserializer=stan__pb2.QuestionRequest.FromString, response_serializer=stan__pb2.QuestionResponse.SerializeToString, ), 'ManyQuestionsManyReponses': grpc.stream_stream_rpc_method_handler( servicer.ManyQuestionsManyReponses, request_deserializer=stan__pb2.QuestionRequest.FromString, response_serializer=stan__pb2.QuestionResponse.SerializeToString, ), 'OneQuestionOneErrorResponse': grpc.unary_unary_rpc_method_handler( servicer.OneQuestionOneErrorResponse, request_deserializer=stan__pb2.QuestionRequest.FromString, response_serializer=stan__pb2.QuestionResponse.SerializeToString, ), 'OneErroredQuestionOneResponse': grpc.unary_unary_rpc_method_handler( servicer.OneErroredQuestionOneResponse, request_deserializer=stan__pb2.QuestionRequest.FromString, response_serializer=stan__pb2.QuestionResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'stan.Stan', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #21
Source File: hetr_pb2.py From ngraph-python with Apache License 2.0 | 5 votes |
def add_HetrServicer_to_server(servicer, server): rpc_method_handlers = { 'BuildTransformer': grpc.unary_unary_rpc_method_handler( servicer.BuildTransformer, request_deserializer=BuildTransformerRequest.FromString, response_serializer=BuildTransformerReply.SerializeToString, ), 'CloseTransformer': grpc.unary_unary_rpc_method_handler( servicer.CloseTransformer, request_deserializer=CloseTransformerRequest.FromString, response_serializer=CloseTransformerReply.SerializeToString, ), 'Computation': grpc.stream_unary_rpc_method_handler( servicer.Computation, request_deserializer=ComputationRequest.FromString, response_serializer=ComputationReply.SerializeToString, ), 'FeedInput': grpc.unary_unary_rpc_method_handler( servicer.FeedInput, request_deserializer=FeedInputRequest.FromString, response_serializer=FeedInputReply.SerializeToString, ), 'GetResults': grpc.unary_unary_rpc_method_handler( servicer.GetResults, request_deserializer=GetResultsRequest.FromString, response_serializer=GetResultsReply.SerializeToString, ), 'Close': grpc.unary_unary_rpc_method_handler( servicer.Close, request_deserializer=CloseRequest.FromString, response_serializer=CloseReply.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'Hetr', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #22
Source File: hetr_pb2_grpc.py From ngraph-python with Apache License 2.0 | 5 votes |
def add_HetrServicer_to_server(servicer, server): rpc_method_handlers = { 'BuildTransformer': grpc.unary_unary_rpc_method_handler( servicer.BuildTransformer, request_deserializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.BuildTransformerRequest.FromString, response_serializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.BuildTransformerReply.SerializeToString, ), 'CloseTransformer': grpc.unary_unary_rpc_method_handler( servicer.CloseTransformer, request_deserializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.CloseTransformerRequest.FromString, response_serializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.CloseTransformerReply.SerializeToString, ), 'Computation': grpc.stream_unary_rpc_method_handler( servicer.Computation, request_deserializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.ComputationRequest.FromString, response_serializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.ComputationReply.SerializeToString, ), 'FeedInput': grpc.unary_unary_rpc_method_handler( servicer.FeedInput, request_deserializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.FeedInputRequest.FromString, response_serializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.FeedInputReply.SerializeToString, ), 'GetResults': grpc.unary_unary_rpc_method_handler( servicer.GetResults, request_deserializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.GetResultsRequest.FromString, response_serializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.GetResultsReply.SerializeToString, ), 'Close': grpc.unary_unary_rpc_method_handler( servicer.Close, request_deserializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.CloseRequest.FromString, response_serializer=ngraph_dot_transformers_dot_hetr_dot_hetr__pb2.CloseReply.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'Hetr', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #23
Source File: greeter_pb2_grpc.py From purerpc with Apache License 2.0 | 5 votes |
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 #24
Source File: gigagenieRPC_pb2_grpc.py From ai-makers-kit with MIT License | 5 votes |
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 |
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: gigagenieRPC_pb2_grpc.py From ai-makers-kit with MIT License | 5 votes |
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 #27
Source File: monitor_pb2_grpc.py From python-app-sdk with MIT License | 4 votes |
def add_MonitorServicer_to_server(servicer, server): rpc_method_handlers = { 'RouterStatus': grpc.stream_unary_rpc_method_handler( servicer.RouterStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), '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, ), 'GatewayUplink': grpc.stream_unary_rpc_method_handler( servicer.GatewayUplink, 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, ), 'GatewayDownlink': grpc.stream_unary_rpc_method_handler( servicer.GatewayDownlink, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.DownlinkMessage.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'BrokerStatus': grpc.stream_unary_rpc_method_handler( servicer.BrokerStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'BrokerUplink': grpc.stream_unary_rpc_method_handler( servicer.BrokerUplink, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeduplicatedUplinkMessage.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'BrokerDownlink': grpc.stream_unary_rpc_method_handler( servicer.BrokerDownlink, 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, ), 'HandlerStatus': grpc.stream_unary_rpc_method_handler( servicer.HandlerStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_handler_dot_handler__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'HandlerUplink': grpc.stream_unary_rpc_method_handler( servicer.HandlerUplink, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeduplicatedUplinkMessage.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'HandlerDownlink': grpc.stream_unary_rpc_method_handler( servicer.HandlerDownlink, 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, ), 'NetworkServerStatus': grpc.stream_unary_rpc_method_handler( servicer.NetworkServerStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_networkserver_dot_networkserver__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'monitor.Monitor', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
Example #28
Source File: monitor_pb2.py From python-app-sdk with MIT License | 4 votes |
def add_MonitorServicer_to_server(servicer, server): rpc_method_handlers = { 'RouterStatus': grpc.stream_unary_rpc_method_handler( servicer.RouterStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), '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, ), 'GatewayUplink': grpc.stream_unary_rpc_method_handler( servicer.GatewayUplink, 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, ), 'GatewayDownlink': grpc.stream_unary_rpc_method_handler( servicer.GatewayDownlink, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_router_dot_router__pb2.DownlinkMessage.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'BrokerStatus': grpc.stream_unary_rpc_method_handler( servicer.BrokerStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'BrokerUplink': grpc.stream_unary_rpc_method_handler( servicer.BrokerUplink, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeduplicatedUplinkMessage.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'BrokerDownlink': grpc.stream_unary_rpc_method_handler( servicer.BrokerDownlink, 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, ), 'HandlerStatus': grpc.stream_unary_rpc_method_handler( servicer.HandlerStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_handler_dot_handler__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'HandlerUplink': grpc.stream_unary_rpc_method_handler( servicer.HandlerUplink, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeduplicatedUplinkMessage.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'HandlerDownlink': grpc.stream_unary_rpc_method_handler( servicer.HandlerDownlink, 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, ), 'NetworkServerStatus': grpc.stream_unary_rpc_method_handler( servicer.NetworkServerStatus, request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_networkserver_dot_networkserver__pb2.Status.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'monitor.Monitor', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))