Python grpc.method_handlers_generic_handler() Examples

The following are 30 code examples for showing how to use grpc.method_handlers_generic_handler(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module grpc , or try the search function .

Example 1
Project: chirpstack-api   Author: brocaar   File: deviceQueue_pb2_grpc.py    License: MIT License 7 votes vote down vote up
def add_DeviceQueueServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Enqueue': grpc.unary_unary_rpc_method_handler(
                    servicer.Enqueue,
                    request_deserializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.EnqueueDeviceQueueItemRequest.FromString,
                    response_serializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.EnqueueDeviceQueueItemResponse.SerializeToString,
            ),
            'Flush': grpc.unary_unary_rpc_method_handler(
                    servicer.Flush,
                    request_deserializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.FlushDeviceQueueRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'List': grpc.unary_unary_rpc_method_handler(
                    servicer.List,
                    request_deserializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.ListDeviceQueueItemsRequest.FromString,
                    response_serializer=chirpstack__api_dot_as__pb_dot_external_dot_api_dot_deviceQueue__pb2.ListDeviceQueueItemsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'api.DeviceQueueService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
Example 2
Project: iroha-python   Author: hyperledger   File: endpoint_pb2_grpc.py    License: 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 3
Project: sea   Author: shanbay   File: worldhello_pb2_grpc.py    License: MIT License 6 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=worldhello__pb2.HelloRequest.FromString,
          response_serializer=worldhello__pb2.HelloReply.SerializeToString,
      ),
      'SayHelloAgain': grpc.unary_unary_rpc_method_handler(
          servicer.SayHelloAgain,
          request_deserializer=worldhello__pb2.HelloRequest.FromString,
          response_serializer=worldhello__pb2.HelloReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'worldhello.Greeter', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 4
Project: sea   Author: shanbay   File: worldhello_pb2.py    License: MIT License 6 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=HelloRequest.FromString,
            response_serializer=HelloReply.SerializeToString,
        ),
        'SayHelloAgain': grpc.unary_unary_rpc_method_handler(
            servicer.SayHelloAgain,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'worldhello.Greeter', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example 5
Project: pcocc   Author: cea-hpc   File: agent_pb2_grpc.py    License: 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 6
Project: marvin-python-toolbox   Author: marvin-ai   File: actions_pb2_grpc.py    License: Apache License 2.0 6 votes vote down vote up
def add_OnlineActionHandlerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      '_remote_execute': grpc.unary_unary_rpc_method_handler(
          servicer._remote_execute,
          request_deserializer=actions__pb2.OnlineActionRequest.FromString,
          response_serializer=actions__pb2.OnlineActionResponse.SerializeToString,
      ),
      '_remote_reload': grpc.unary_unary_rpc_method_handler(
          servicer._remote_reload,
          request_deserializer=actions__pb2.ReloadRequest.FromString,
          response_serializer=actions__pb2.ReloadResponse.SerializeToString,
      ),
      '_health_check': grpc.unary_unary_rpc_method_handler(
          servicer._health_check,
          request_deserializer=actions__pb2.HealthCheckRequest.FromString,
          response_serializer=actions__pb2.HealthCheckResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'OnlineActionHandler', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 7
Project: marvin-python-toolbox   Author: marvin-ai   File: actions_pb2_grpc.py    License: Apache License 2.0 6 votes vote down vote up
def add_BatchActionHandlerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      '_remote_execute': grpc.unary_unary_rpc_method_handler(
          servicer._remote_execute,
          request_deserializer=actions__pb2.BatchActionRequest.FromString,
          response_serializer=actions__pb2.BatchActionResponse.SerializeToString,
      ),
      '_remote_reload': grpc.unary_unary_rpc_method_handler(
          servicer._remote_reload,
          request_deserializer=actions__pb2.ReloadRequest.FromString,
          response_serializer=actions__pb2.ReloadResponse.SerializeToString,
      ),
      '_health_check': grpc.unary_unary_rpc_method_handler(
          servicer._health_check,
          request_deserializer=actions__pb2.HealthCheckRequest.FromString,
          response_serializer=actions__pb2.HealthCheckResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'BatchActionHandler', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 8
Project: marvin-python-toolbox   Author: marvin-ai   File: actions_pb2.py    License: Apache License 2.0 6 votes vote down vote up
def add_OnlineActionHandlerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        '_remote_execute': grpc.unary_unary_rpc_method_handler(
            servicer._remote_execute,
            request_deserializer=OnlineActionRequest.FromString,
            response_serializer=OnlineActionResponse.SerializeToString,
        ),
        '_remote_reload': grpc.unary_unary_rpc_method_handler(
            servicer._remote_reload,
            request_deserializer=ReloadRequest.FromString,
            response_serializer=ReloadResponse.SerializeToString,
        ),
        '_health_check': grpc.unary_unary_rpc_method_handler(
            servicer._health_check,
            request_deserializer=HealthCheckRequest.FromString,
            response_serializer=HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'OnlineActionHandler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example 9
Project: marvin-python-toolbox   Author: marvin-ai   File: actions_pb2.py    License: Apache License 2.0 6 votes vote down vote up
def add_BatchActionHandlerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        '_remote_execute': grpc.unary_unary_rpc_method_handler(
            servicer._remote_execute,
            request_deserializer=BatchActionRequest.FromString,
            response_serializer=BatchActionResponse.SerializeToString,
        ),
        '_remote_reload': grpc.unary_unary_rpc_method_handler(
            servicer._remote_reload,
            request_deserializer=ReloadRequest.FromString,
            response_serializer=ReloadResponse.SerializeToString,
        ),
        '_health_check': grpc.unary_unary_rpc_method_handler(
            servicer._health_check,
            request_deserializer=HealthCheckRequest.FromString,
            response_serializer=HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'BatchActionHandler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example 10
Project: chirpstack-api   Author: brocaar   File: geo_pb2_grpc.py    License: MIT License 6 votes vote down vote up
def add_GeolocationServerServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ResolveTDOA': grpc.unary_unary_rpc_method_handler(
                    servicer.ResolveTDOA,
                    request_deserializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveTDOARequest.FromString,
                    response_serializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveTDOAResponse.SerializeToString,
            ),
            'ResolveMultiFrameTDOA': grpc.unary_unary_rpc_method_handler(
                    servicer.ResolveMultiFrameTDOA,
                    request_deserializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveMultiFrameTDOARequest.FromString,
                    response_serializer=chirpstack__api_dot_geo_dot_geo__pb2.ResolveMultiFrameTDOAResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'geo.GeolocationServerService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
Example 11
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 12
Project: FATE   Author: FederatedAI   File: model_service_pb2_grpc.py    License: Apache License 2.0 6 votes vote down vote up
def add_ModelServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'publishLoad': grpc.unary_unary_rpc_method_handler(
          servicer.publishLoad,
          request_deserializer=model__service__pb2.PublishRequest.FromString,
          response_serializer=model__service__pb2.PublishResponse.SerializeToString,
      ),
      'publishBind': grpc.unary_unary_rpc_method_handler(
          servicer.publishBind,
          request_deserializer=model__service__pb2.PublishRequest.FromString,
          response_serializer=model__service__pb2.PublishResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.fate.api.mlmodel.manager.ModelService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 13
Project: FATE   Author: FederatedAI   File: inference_service_pb2_grpc.py    License: Apache License 2.0 6 votes vote down vote up
def add_InferenceServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'inference': grpc.unary_unary_rpc_method_handler(
          servicer.inference,
          request_deserializer=inference__service__pb2.InferenceMessage.FromString,
          response_serializer=inference__service__pb2.InferenceMessage.SerializeToString,
      ),
      'startInferenceJob': grpc.unary_unary_rpc_method_handler(
          servicer.startInferenceJob,
          request_deserializer=inference__service__pb2.InferenceMessage.FromString,
          response_serializer=inference__service__pb2.InferenceMessage.SerializeToString,
      ),
      'getInferenceResult': grpc.unary_unary_rpc_method_handler(
          servicer.getInferenceResult,
          request_deserializer=inference__service__pb2.InferenceMessage.FromString,
          response_serializer=inference__service__pb2.InferenceMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'com.webank.ai.fate.api.serving.InferenceService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 14
Project: FATE   Author: FederatedAI   File: fate_proxy_pb2_grpc.py    License: 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 15
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 16
Project: MAVSDK-Python   Author: mavlink   File: shell_pb2_grpc.py    License: 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 17
Project: MAVSDK-Python   Author: mavlink   File: gimbal_pb2_grpc.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def add_GimbalServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SetPitchAndYaw': grpc.unary_unary_rpc_method_handler(
                    servicer.SetPitchAndYaw,
                    request_deserializer=gimbal_dot_gimbal__pb2.SetPitchAndYawRequest.FromString,
                    response_serializer=gimbal_dot_gimbal__pb2.SetPitchAndYawResponse.SerializeToString,
            ),
            'SetMode': grpc.unary_unary_rpc_method_handler(
                    servicer.SetMode,
                    request_deserializer=gimbal_dot_gimbal__pb2.SetModeRequest.FromString,
                    response_serializer=gimbal_dot_gimbal__pb2.SetModeResponse.SerializeToString,
            ),
            'SetRoiLocation': grpc.unary_unary_rpc_method_handler(
                    servicer.SetRoiLocation,
                    request_deserializer=gimbal_dot_gimbal__pb2.SetRoiLocationRequest.FromString,
                    response_serializer=gimbal_dot_gimbal__pb2.SetRoiLocationResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'mavsdk.rpc.gimbal.GimbalService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API. 
Example 18
Project: MAVSDK-Python   Author: mavlink   File: core_pb2_grpc.py    License: 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 19
Project: pydgraph   Author: dgraph-io   File: api_pb2_grpc.py    License: Apache License 2.0 5 votes vote down vote up
def add_DgraphServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Login': grpc.unary_unary_rpc_method_handler(
          servicer.Login,
          request_deserializer=api__pb2.LoginRequest.FromString,
          response_serializer=api__pb2.Response.SerializeToString,
      ),
      'Query': grpc.unary_unary_rpc_method_handler(
          servicer.Query,
          request_deserializer=api__pb2.Request.FromString,
          response_serializer=api__pb2.Response.SerializeToString,
      ),
      'Alter': grpc.unary_unary_rpc_method_handler(
          servicer.Alter,
          request_deserializer=api__pb2.Operation.FromString,
          response_serializer=api__pb2.Payload.SerializeToString,
      ),
      'CommitOrAbort': grpc.unary_unary_rpc_method_handler(
          servicer.CommitOrAbort,
          request_deserializer=api__pb2.TxnContext.FromString,
          response_serializer=api__pb2.TxnContext.SerializeToString,
      ),
      'CheckVersion': grpc.unary_unary_rpc_method_handler(
          servicer.CheckVersion,
          request_deserializer=api__pb2.Check.FromString,
          response_serializer=api__pb2.Version.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'api.Dgraph', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 20
Project: lnd_grpc   Author: willcl-ark   File: invoices_pb2_grpc.py    License: MIT License 5 votes vote down vote up
def add_InvoicesServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SubscribeSingleInvoice': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeSingleInvoice,
          request_deserializer=lnd__grpc_dot_protos_dot_invoices__pb2.SubscribeSingleInvoiceRequest.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_rpc__pb2.Invoice.SerializeToString,
      ),
      'CancelInvoice': grpc.unary_unary_rpc_method_handler(
          servicer.CancelInvoice,
          request_deserializer=lnd__grpc_dot_protos_dot_invoices__pb2.CancelInvoiceMsg.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_invoices__pb2.CancelInvoiceResp.SerializeToString,
      ),
      'AddHoldInvoice': grpc.unary_unary_rpc_method_handler(
          servicer.AddHoldInvoice,
          request_deserializer=lnd__grpc_dot_protos_dot_invoices__pb2.AddHoldInvoiceRequest.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_invoices__pb2.AddHoldInvoiceResp.SerializeToString,
      ),
      'SettleInvoice': grpc.unary_unary_rpc_method_handler(
          servicer.SettleInvoice,
          request_deserializer=lnd__grpc_dot_protos_dot_invoices__pb2.SettleInvoiceMsg.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_invoices__pb2.SettleInvoiceResp.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'invoicesrpc.Invoices', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 21
Project: lnd_grpc   Author: willcl-ark   File: rpc_pb2_grpc.py    License: MIT License 5 votes vote down vote up
def add_WalletUnlockerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GenSeed': grpc.unary_unary_rpc_method_handler(
          servicer.GenSeed,
          request_deserializer=lnd__grpc_dot_protos_dot_rpc__pb2.GenSeedRequest.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_rpc__pb2.GenSeedResponse.SerializeToString,
      ),
      'InitWallet': grpc.unary_unary_rpc_method_handler(
          servicer.InitWallet,
          request_deserializer=lnd__grpc_dot_protos_dot_rpc__pb2.InitWalletRequest.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_rpc__pb2.InitWalletResponse.SerializeToString,
      ),
      'UnlockWallet': grpc.unary_unary_rpc_method_handler(
          servicer.UnlockWallet,
          request_deserializer=lnd__grpc_dot_protos_dot_rpc__pb2.UnlockWalletRequest.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_rpc__pb2.UnlockWalletResponse.SerializeToString,
      ),
      'ChangePassword': grpc.unary_unary_rpc_method_handler(
          servicer.ChangePassword,
          request_deserializer=lnd__grpc_dot_protos_dot_rpc__pb2.ChangePasswordRequest.FromString,
          response_serializer=lnd__grpc_dot_protos_dot_rpc__pb2.ChangePasswordResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'lnrpc.WalletUnlocker', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 22
Project: lnd_grpc   Author: willcl-ark   File: loop_client_pb2_grpc.py    License: 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 23
Project: zun   Author: openstack   File: api_pb2_grpc.py    License: Apache License 2.0 5 votes vote down vote up
def add_ImageServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ListImages': grpc.unary_unary_rpc_method_handler(
          servicer.ListImages,
          request_deserializer=zun_dot_criapi_dot_api__pb2.ListImagesRequest.FromString,
          response_serializer=zun_dot_criapi_dot_api__pb2.ListImagesResponse.SerializeToString,
      ),
      'ImageStatus': grpc.unary_unary_rpc_method_handler(
          servicer.ImageStatus,
          request_deserializer=zun_dot_criapi_dot_api__pb2.ImageStatusRequest.FromString,
          response_serializer=zun_dot_criapi_dot_api__pb2.ImageStatusResponse.SerializeToString,
      ),
      'PullImage': grpc.unary_unary_rpc_method_handler(
          servicer.PullImage,
          request_deserializer=zun_dot_criapi_dot_api__pb2.PullImageRequest.FromString,
          response_serializer=zun_dot_criapi_dot_api__pb2.PullImageResponse.SerializeToString,
      ),
      'RemoveImage': grpc.unary_unary_rpc_method_handler(
          servicer.RemoveImage,
          request_deserializer=zun_dot_criapi_dot_api__pb2.RemoveImageRequest.FromString,
          response_serializer=zun_dot_criapi_dot_api__pb2.RemoveImageResponse.SerializeToString,
      ),
      'ImageFsInfo': grpc.unary_unary_rpc_method_handler(
          servicer.ImageFsInfo,
          request_deserializer=zun_dot_criapi_dot_api__pb2.ImageFsInfoRequest.FromString,
          response_serializer=zun_dot_criapi_dot_api__pb2.ImageFsInfoResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'runtime.v1alpha2.ImageService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 24
Project: raspiblitz   Author: rootzoll   File: rpc_pb2_grpc.py    License: MIT License 5 votes vote down vote up
def add_WalletUnlockerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GenSeed': grpc.unary_unary_rpc_method_handler(
          servicer.GenSeed,
          request_deserializer=rpc__pb2.GenSeedRequest.FromString,
          response_serializer=rpc__pb2.GenSeedResponse.SerializeToString,
      ),
      'InitWallet': grpc.unary_unary_rpc_method_handler(
          servicer.InitWallet,
          request_deserializer=rpc__pb2.InitWalletRequest.FromString,
          response_serializer=rpc__pb2.InitWalletResponse.SerializeToString,
      ),
      'UnlockWallet': grpc.unary_unary_rpc_method_handler(
          servicer.UnlockWallet,
          request_deserializer=rpc__pb2.UnlockWalletRequest.FromString,
          response_serializer=rpc__pb2.UnlockWalletResponse.SerializeToString,
      ),
      'ChangePassword': grpc.unary_unary_rpc_method_handler(
          servicer.ChangePassword,
          request_deserializer=rpc__pb2.ChangePasswordRequest.FromString,
          response_serializer=rpc__pb2.ChangePasswordResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'lnrpc.WalletUnlocker', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 25
def add_PredictionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Predict': grpc.unary_unary_rpc_method_handler(
            servicer.Predict,
            request_deserializer=PredictRequest.FromString,
            response_serializer=PredictResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'tensorflow.serving.PredictionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example 26
Project: kuryr-kubernetes   Author: openstack   File: api_pb2_grpc.py    License: Apache License 2.0 5 votes vote down vote up
def add_PodResourcesListerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'List': grpc.unary_unary_rpc_method_handler(
          servicer.List,
          request_deserializer=kuryr__kubernetes_dot_pod__resources_dot_api__pb2.ListPodResourcesRequest.FromString,
          response_serializer=kuryr__kubernetes_dot_pod__resources_dot_api__pb2.ListPodResourcesResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'v1alpha1.PodResourcesLister', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 27
Project: iroha-python   Author: hyperledger   File: endpoint_pb2_grpc.py    License: 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 28
Project: go-ml-transpiler   Author: znly   File: service_pb2_grpc.py    License: Apache License 2.0 5 votes vote down vote up
def add_ModelServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Forward': grpc.unary_unary_rpc_method_handler(
          servicer.Forward,
          request_deserializer=service__pb2.ModelInput.FromString,
          response_serializer=service__pb2.ModelOutput.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'server.Model', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 29
Project: sea   Author: shanbay   File: helloworld_pb2_grpc.py    License: MIT License 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=helloworld__pb2.HelloRequest.FromString,
          response_serializer=helloworld__pb2.HelloReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'helloworld.Greeter', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,)) 
Example 30
Project: sea   Author: shanbay   File: helloworld_pb2.py    License: MIT License 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=HelloRequest.FromString,
            response_serializer=HelloReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'helloworld.Greeter', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))