Python grpc 模块,unary_unary_rpc_method_handler() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用grpc.unary_unary_rpc_method_handler()

项目:experiment    作者:blueCat1301    | 项目源码 | 文件源码
def add_ExperimentServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'StartExperiment': grpc.unary_unary_rpc_method_handler(
          servicer.StartExperiment,
          request_deserializer=Experiment.FromString,
          response_serializer=ExperimentStatus.SerializeToString,
      ),
      'StopExperiment': grpc.unary_unary_rpc_method_handler(
          servicer.StopExperiment,
          request_deserializer=Experiment.FromString,
          response_serializer=ExperimentStatus.SerializeToString,
      ),
      'GetExperimentStatus': grpc.unary_unary_rpc_method_handler(
          servicer.GetExperimentStatus,
          request_deserializer=ExperimentId.FromString,
          response_serializer=ExperimentStatus.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'experiment.ExperimentService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:p2p_grpc_blockchain_package    作者:Lursun    | 项目源码 | 文件源码
def add_DiscoveryServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ExchangeNode': grpc.unary_unary_rpc_method_handler(
          servicer.ExchangeNode,
          request_deserializer=grpc__pb2.Node.FromString,
          response_serializer=grpc__pb2.Node.SerializeToString,
      ),
      'Hello': grpc.unary_unary_rpc_method_handler(
          servicer.Hello,
          request_deserializer=grpc__pb2.Message.FromString,
          response_serializer=grpc__pb2.Message.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Discovery', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:p2p_grpc_blockchain_package    作者:Lursun    | 项目源码 | 文件源码
def add_DiscoveryServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'ExchangeNode': grpc.unary_unary_rpc_method_handler(
            servicer.ExchangeNode,
            request_deserializer=Node.FromString,
            response_serializer=Node.SerializeToString,
        ),
        'Hello': grpc.unary_unary_rpc_method_handler(
            servicer.Hello,
            request_deserializer=Message.FromString,
            response_serializer=Message.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'Discovery', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:gRPC-Makerboards    作者:PeridotYouClod    | 项目源码 | 文件源码
def add_PushFrontEndServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Subscribe': grpc.unary_unary_rpc_method_handler(
          servicer.Subscribe,
          request_deserializer=SubscribeRequest.FromString,
          response_serializer=SubscribeReply.SerializeToString,
      ),
      'StreamButtonPressed': grpc.unary_stream_rpc_method_handler(
          servicer.StreamButtonPressed,
          request_deserializer=GetButtonPressedRequest.FromString,
          response_serializer=GetButtonPressedReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'PushFrontEnd', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:gRPC-Makerboards    作者:PeridotYouClod    | 项目源码 | 文件源码
def add_ArduinoServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetIrButtonPressed': grpc.unary_unary_rpc_method_handler(
          servicer.GetIrButtonPressed,
          request_deserializer=GetIrButtonPressedRequest.FromString,
          response_serializer=GetIrButtonPressedReply.SerializeToString,
      ),
      'GetSonar': grpc.unary_unary_rpc_method_handler(
          servicer.GetSonar,
          request_deserializer=GetSonarRequest.FromString,
          response_serializer=GetSonarReply.SerializeToString,
      ),
      'SendToRfBlaster': grpc.unary_unary_rpc_method_handler(
          servicer.SendToRfBlaster,
          request_deserializer=SendToRfBlasterRequest.FromString,
          response_serializer=SendToRfBlasterReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Arduino', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:gRPC-Makerboards    作者:PeridotYouClod    | 项目源码 | 文件源码
def add_PushServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Subscribe': grpc.unary_unary_rpc_method_handler(
          servicer.Subscribe,
          request_deserializer=SubscribeRequest.FromString,
          response_serializer=SubscribeReply.SerializeToString,
      ),
      'StreamButtonPressed': grpc.unary_stream_rpc_method_handler(
          servicer.StreamButtonPressed,
          request_deserializer=GetButtonPressedRequest.FromString,
          response_serializer=GetButtonPressedReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Push', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:experiment-manager    作者:softfire-eu    | 项目源码 | 文件源码
def add_RegistrationServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'register': grpc.unary_unary_rpc_method_handler(
          servicer.register,
          request_deserializer=messages__pb2.RegisterMessage.FromString,
          response_serializer=messages__pb2.ResponseMessage.SerializeToString,
      ),
      'unregister': grpc.unary_unary_rpc_method_handler(
          servicer.unregister,
          request_deserializer=messages__pb2.UnregisterMessage.FromString,
          response_serializer=messages__pb2.ResponseMessage.SerializeToString,
      ),
      'update_status': grpc.unary_unary_rpc_method_handler(
          servicer.update_status,
          request_deserializer=messages__pb2.StatusMessage.FromString,
          response_serializer=messages__pb2.ResponseMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'RegistrationService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:experiment-manager    作者:softfire-eu    | 项目源码 | 文件源码
def add_RegistrationServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'register': grpc.unary_unary_rpc_method_handler(
            servicer.register,
            request_deserializer=RegisterMessage.FromString,
            response_serializer=ResponseMessage.SerializeToString,
        ),
        'unregister': grpc.unary_unary_rpc_method_handler(
            servicer.unregister,
            request_deserializer=UnregisterMessage.FromString,
            response_serializer=ResponseMessage.SerializeToString,
        ),
        'update_status': grpc.unary_unary_rpc_method_handler(
            servicer.update_status,
            request_deserializer=StatusMessage.FromString,
            response_serializer=ResponseMessage.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'RegistrationService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:yarntf    作者:tobiajo    | 项目源码 | 文件源码
def add_ClusterSpecGeneratorServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'RegisterContainer': grpc.unary_unary_rpc_method_handler(
            servicer.RegisterContainer,
            request_deserializer=RegisterContainerRequest.FromString,
            response_serializer=RegisterContainerReply.SerializeToString,
        ),
        'GetClusterSpec': grpc.unary_unary_rpc_method_handler(
            servicer.GetClusterSpec,
            request_deserializer=GetClusterSpecRequest.FromString,
            response_serializer=GetClusterSpecReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'clusterspecgenerator.ClusterSpecGenerator', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:yarntf    作者:tobiajo    | 项目源码 | 文件源码
def add_ClusterSpecGeneratorServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'RegisterContainer': grpc.unary_unary_rpc_method_handler(
          servicer.RegisterContainer,
          request_deserializer=clusterspecgenerator__pb2.RegisterContainerRequest.FromString,
          response_serializer=clusterspecgenerator__pb2.RegisterContainerReply.SerializeToString,
      ),
      'GetClusterSpec': grpc.unary_unary_rpc_method_handler(
          servicer.GetClusterSpec,
          request_deserializer=clusterspecgenerator__pb2.GetClusterSpecRequest.FromString,
          response_serializer=clusterspecgenerator__pb2.GetClusterSpecReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'clusterspecgenerator.ClusterSpecGenerator', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:object-tracking    作者:athenian-robotics    | 项目源码 | 文件源码
def add_LocationServiceServicer_to_server(servicer, server):
        rpc_method_handlers = {
            'registerClient': grpc.unary_unary_rpc_method_handler(
                servicer.registerClient,
                request_deserializer=ClientInfo.FromString,
                response_serializer=ServerInfo.SerializeToString,
            ),
            'getLocations': grpc.unary_stream_rpc_method_handler(
                servicer.getLocations,
                request_deserializer=ClientInfo.FromString,
                response_serializer=Location.SerializeToString,
            ),
        }
        generic_handler = grpc.method_handlers_generic_handler(
            'opencv_object_tracking.LocationService', rpc_method_handlers)
        server.add_generic_rpc_handlers((generic_handler,))
项目:object-tracking    作者:athenian-robotics    | 项目源码 | 文件源码
def add_LocationServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'registerClient': grpc.unary_unary_rpc_method_handler(
            servicer.registerClient,
            request_deserializer=proto_dot_location__service__pb2.ClientInfo.FromString,
            response_serializer=proto_dot_location__service__pb2.ServerInfo.SerializeToString,
        ),
        'getLocations': grpc.unary_stream_rpc_method_handler(
            servicer.getLocations,
            request_deserializer=proto_dot_location__service__pb2.ClientInfo.FromString,
            response_serializer=proto_dot_location__service__pb2.Location.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'opencv_object_tracking.LocationService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:sea    作者:shanbay    | 项目源码 | 文件源码
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,))
项目:sea    作者:shanbay    | 项目源码 | 文件源码
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,))
项目:hops-tensorflow    作者:hopshadoop    | 项目源码 | 文件源码
def add_ClusterSpecGeneratorServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'RegisterContainer': grpc.unary_unary_rpc_method_handler(
            servicer.RegisterContainer,
            request_deserializer=RegisterContainerRequest.FromString,
            response_serializer=RegisterContainerReply.SerializeToString,
        ),
        'GetClusterSpec': grpc.unary_unary_rpc_method_handler(
            servicer.GetClusterSpec,
            request_deserializer=GetClusterSpecRequest.FromString,
            response_serializer=GetClusterSpecReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'clusterspecgenerator.ClusterSpecGenerator', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:hops-tensorflow    作者:hopshadoop    | 项目源码 | 文件源码
def add_ClusterSpecGeneratorServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'RegisterContainer': grpc.unary_unary_rpc_method_handler(
          servicer.RegisterContainer,
          request_deserializer=clusterspecgenerator__pb2.RegisterContainerRequest.FromString,
          response_serializer=clusterspecgenerator__pb2.RegisterContainerReply.SerializeToString,
      ),
      'GetClusterSpec': grpc.unary_unary_rpc_method_handler(
          servicer.GetClusterSpec,
          request_deserializer=clusterspecgenerator__pb2.GetClusterSpecRequest.FromString,
          response_serializer=clusterspecgenerator__pb2.GetClusterSpecReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'clusterspecgenerator.ClusterSpecGenerator', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:QRL    作者:theQRL    | 项目源码 | 文件源码
def add_P2PAPIServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetNodeState': grpc.unary_unary_rpc_method_handler(
          servicer.GetNodeState,
          request_deserializer=qrl__pb2.GetNodeStateReq.FromString,
          response_serializer=qrl__pb2.GetNodeStateResp.SerializeToString,
      ),
      'GetKnownPeers': grpc.unary_unary_rpc_method_handler(
          servicer.GetKnownPeers,
          request_deserializer=qrl__pb2.GetKnownPeersReq.FromString,
          response_serializer=qrl__pb2.GetKnownPeersResp.SerializeToString,
      ),
      'GetBlock': grpc.unary_unary_rpc_method_handler(
          servicer.GetBlock,
          request_deserializer=qrl__pb2.GetBlockReq.FromString,
          response_serializer=qrl__pb2.GetBlockResp.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'qrl.P2PAPI', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:python-cri    作者:feiskyer    | 项目源码 | 文件源码
def add_ImageServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ListImages': grpc.unary_unary_rpc_method_handler(
          servicer.ListImages,
          request_deserializer=api__pb2.ListImagesRequest.FromString,
          response_serializer=api__pb2.ListImagesResponse.SerializeToString,
      ),
      'ImageStatus': grpc.unary_unary_rpc_method_handler(
          servicer.ImageStatus,
          request_deserializer=api__pb2.ImageStatusRequest.FromString,
          response_serializer=api__pb2.ImageStatusResponse.SerializeToString,
      ),
      'PullImage': grpc.unary_unary_rpc_method_handler(
          servicer.PullImage,
          request_deserializer=api__pb2.PullImageRequest.FromString,
          response_serializer=api__pb2.PullImageResponse.SerializeToString,
      ),
      'RemoveImage': grpc.unary_unary_rpc_method_handler(
          servicer.RemoveImage,
          request_deserializer=api__pb2.RemoveImageRequest.FromString,
          response_serializer=api__pb2.RemoveImageResponse.SerializeToString,
      ),
      'ImageFsInfo': grpc.unary_unary_rpc_method_handler(
          servicer.ImageFsInfo,
          request_deserializer=api__pb2.ImageFsInfoRequest.FromString,
          response_serializer=api__pb2.ImageFsInfoResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'runtime.ImageService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:python-cri    作者:feiskyer    | 项目源码 | 文件源码
def add_ImageServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'ListImages': grpc.unary_unary_rpc_method_handler(
            servicer.ListImages,
            request_deserializer=ListImagesRequest.FromString,
            response_serializer=ListImagesResponse.SerializeToString,
        ),
        'ImageStatus': grpc.unary_unary_rpc_method_handler(
            servicer.ImageStatus,
            request_deserializer=ImageStatusRequest.FromString,
            response_serializer=ImageStatusResponse.SerializeToString,
        ),
        'PullImage': grpc.unary_unary_rpc_method_handler(
            servicer.PullImage,
            request_deserializer=PullImageRequest.FromString,
            response_serializer=PullImageResponse.SerializeToString,
        ),
        'RemoveImage': grpc.unary_unary_rpc_method_handler(
            servicer.RemoveImage,
            request_deserializer=RemoveImageRequest.FromString,
            response_serializer=RemoveImageResponse.SerializeToString,
        ),
        'ImageFsInfo': grpc.unary_unary_rpc_method_handler(
            servicer.ImageFsInfo,
            request_deserializer=ImageFsInfoRequest.FromString,
            response_serializer=ImageFsInfoResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'runtime.ImageService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:fabric-sdk-py    作者:hyperledger    | 项目源码 | 文件源码
def add_AdminServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GetStatus': grpc.unary_unary_rpc_method_handler(
            servicer.GetStatus,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=ServerStatus.SerializeToString,
        ),
        'StartServer': grpc.unary_unary_rpc_method_handler(
            servicer.StartServer,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=ServerStatus.SerializeToString,
        ),
        'GetModuleLogLevel': grpc.unary_unary_rpc_method_handler(
            servicer.GetModuleLogLevel,
            request_deserializer=LogLevelRequest.FromString,
            response_serializer=LogLevelResponse.SerializeToString,
        ),
        'SetModuleLogLevel': grpc.unary_unary_rpc_method_handler(
            servicer.SetModuleLogLevel,
            request_deserializer=LogLevelRequest.FromString,
            response_serializer=LogLevelResponse.SerializeToString,
        ),
        'RevertLogLevels': grpc.unary_unary_rpc_method_handler(
            servicer.RevertLogLevels,
            request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'protos.Admin', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:fabric-sdk-py    作者:hyperledger    | 项目源码 | 文件源码
def add_EndorserServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ProcessProposal': grpc.unary_unary_rpc_method_handler(
          servicer.ProcessProposal,
          request_deserializer=hfc_dot_protos_dot_peer_dot_proposal__pb2.SignedProposal.FromString,
          response_serializer=hfc_dot_protos_dot_peer_dot_proposal__response__pb2.ProposalResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'protos.Endorser', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:fabric-sdk-py    作者:hyperledger    | 项目源码 | 文件源码
def add_AdminServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetStatus': grpc.unary_unary_rpc_method_handler(
          servicer.GetStatus,
          request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
          response_serializer=hfc_dot_protos_dot_peer_dot_admin__pb2.ServerStatus.SerializeToString,
      ),
      'StartServer': grpc.unary_unary_rpc_method_handler(
          servicer.StartServer,
          request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
          response_serializer=hfc_dot_protos_dot_peer_dot_admin__pb2.ServerStatus.SerializeToString,
      ),
      'GetModuleLogLevel': grpc.unary_unary_rpc_method_handler(
          servicer.GetModuleLogLevel,
          request_deserializer=hfc_dot_protos_dot_peer_dot_admin__pb2.LogLevelRequest.FromString,
          response_serializer=hfc_dot_protos_dot_peer_dot_admin__pb2.LogLevelResponse.SerializeToString,
      ),
      'SetModuleLogLevel': grpc.unary_unary_rpc_method_handler(
          servicer.SetModuleLogLevel,
          request_deserializer=hfc_dot_protos_dot_peer_dot_admin__pb2.LogLevelRequest.FromString,
          response_serializer=hfc_dot_protos_dot_peer_dot_admin__pb2.LogLevelResponse.SerializeToString,
      ),
      'RevertLogLevels': grpc.unary_unary_rpc_method_handler(
          servicer.RevertLogLevels,
          request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'protos.Admin', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:fabric-sdk-py    作者:hyperledger    | 项目源码 | 文件源码
def add_EndorserServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'ProcessProposal': grpc.unary_unary_rpc_method_handler(
            servicer.ProcessProposal,
            request_deserializer=hfc_dot_protos_dot_peer_dot_proposal__pb2.SignedProposal.FromString,
            response_serializer=hfc_dot_protos_dot_peer_dot_proposal__response__pb2.ProposalResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'protos.Endorser', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:grpc-kubernetes-skl-tutorial    作者:pprett    | 项目源码 | 文件源码
def add_PredictionServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Predict': grpc.unary_unary_rpc_method_handler(
          servicer.Predict,
          request_deserializer=predict__pb2.PredictionRequest.FromString,
          response_serializer=predict__pb2.PredictionResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'skl.PredictionService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:grpc-resolver    作者:justdoit0823    | 项目源码 | 文件源码
def add_HelloServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Greeter': grpc.unary_unary_rpc_method_handler(
          servicer.Greeter,
          request_deserializer=hello__pb2.HelloRequest.FromString,
          response_serializer=hello__pb2.HelloResponse.SerializeToString,
      ),
      'GreeterResponseStream': grpc.unary_stream_rpc_method_handler(
          servicer.GreeterResponseStream,
          request_deserializer=hello__pb2.HelloRequest.FromString,
          response_serializer=hello__pb2.HelloResponse.SerializeToString,
      ),
      'StreamGreeter': grpc.stream_unary_rpc_method_handler(
          servicer.StreamGreeter,
          request_deserializer=hello__pb2.HelloRequest.FromString,
          response_serializer=hello__pb2.HelloResponse.SerializeToString,
      ),
      'StreamGreeterResponseStream': grpc.stream_stream_rpc_method_handler(
          servicer.StreamGreeterResponseStream,
          request_deserializer=hello__pb2.HelloRequest.FromString,
          response_serializer=hello__pb2.HelloResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'grpcresolver.hello.Hello', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:grpc-resolver    作者:justdoit0823    | 项目源码 | 文件源码
def add_HelloServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Greeter': grpc.unary_unary_rpc_method_handler(
            servicer.Greeter,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloResponse.SerializeToString,
        ),
        'GreeterResponseStream': grpc.unary_stream_rpc_method_handler(
            servicer.GreeterResponseStream,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloResponse.SerializeToString,
        ),
        'StreamGreeter': grpc.stream_unary_rpc_method_handler(
            servicer.StreamGreeter,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloResponse.SerializeToString,
        ),
        'StreamGreeterResponseStream': grpc.stream_stream_rpc_method_handler(
            servicer.StreamGreeterResponseStream,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'grpcresolver.hello.Hello', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:aquests    作者:hansroh    | 项目源码 | 文件源码
def add_RouteGuideServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GetFeature': grpc.unary_unary_rpc_method_handler(
            servicer.GetFeature,
            request_deserializer=Point.FromString,
            response_serializer=Feature.SerializeToString,
        ),
        'ListFeatures': grpc.unary_stream_rpc_method_handler(
            servicer.ListFeatures,
            request_deserializer=Rectangle.FromString,
            response_serializer=Feature.SerializeToString,
        ),
        'RecordRoute': grpc.stream_unary_rpc_method_handler(
            servicer.RecordRoute,
            request_deserializer=Point.FromString,
            response_serializer=RouteSummary.SerializeToString,
        ),
        'RouteChat': grpc.stream_stream_rpc_method_handler(
            servicer.RouteChat,
            request_deserializer=RouteNote.FromString,
            response_serializer=RouteNote.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'routeguide.RouteGuide', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:rest-thrift-grpc    作者:danielfbm    | 项目源码 | 文件源码
def add_StructServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'create': grpc.unary_unary_rpc_method_handler(
          servicer.create,
          request_deserializer=Structure.FromString,
          response_serializer=Response.SerializeToString,
      ),
      'retrieve': grpc.unary_unary_rpc_method_handler(
          servicer.retrieve,
          request_deserializer=Empty.FromString,
          response_serializer=Structure.SerializeToString,
      ),
      'many': grpc.unary_unary_rpc_method_handler(
          servicer.many,
          request_deserializer=Empty.FromString,
          response_serializer=StructureList.SerializeToString,
      ),
      'bulk': grpc.unary_unary_rpc_method_handler(
          servicer.bulk,
          request_deserializer=StructureList.FromString,
          response_serializer=Response.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'structure.StructService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:ngraph    作者:NervanaSystems    | 项目源码 | 文件源码
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,))
项目:ngraph    作者:NervanaSystems    | 项目源码 | 文件源码
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,))
项目:p2p_grpc_blockchain_package    作者:Lursun    | 项目源码 | 文件源码
def add_SynchronizationServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'BlockFrom': grpc.unary_unary_rpc_method_handler(
          servicer.BlockFrom,
          request_deserializer=grpc__pb2.Message.FromString,
          response_serializer=grpc__pb2.Block.SerializeToString,
      ),
      'BlockTo': grpc.unary_unary_rpc_method_handler(
          servicer.BlockTo,
          request_deserializer=grpc__pb2.Block.FromString,
          response_serializer=grpc__pb2.Message.SerializeToString,
      ),
      'ExchangeBlock': grpc.unary_unary_rpc_method_handler(
          servicer.ExchangeBlock,
          request_deserializer=grpc__pb2.Block.FromString,
          response_serializer=grpc__pb2.Block.SerializeToString,
      ),
      'TransactionTo': grpc.unary_unary_rpc_method_handler(
          servicer.TransactionTo,
          request_deserializer=grpc__pb2.Transaction.FromString,
          response_serializer=grpc__pb2.Message.SerializeToString,
      ),
      'TransactionFrom': grpc.unary_unary_rpc_method_handler(
          servicer.TransactionFrom,
          request_deserializer=grpc__pb2.Message.FromString,
          response_serializer=grpc__pb2.Transaction.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Synchronization', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:p2p_grpc_blockchain_package    作者:Lursun    | 项目源码 | 文件源码
def add_SynchronizationServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'BlockFrom': grpc.unary_unary_rpc_method_handler(
            servicer.BlockFrom,
            request_deserializer=Message.FromString,
            response_serializer=Block.SerializeToString,
        ),
        'BlockTo': grpc.unary_unary_rpc_method_handler(
            servicer.BlockTo,
            request_deserializer=Block.FromString,
            response_serializer=Message.SerializeToString,
        ),
        'ExchangeBlock': grpc.unary_unary_rpc_method_handler(
            servicer.ExchangeBlock,
            request_deserializer=Block.FromString,
            response_serializer=Block.SerializeToString,
        ),
        'TransactionTo': grpc.unary_unary_rpc_method_handler(
            servicer.TransactionTo,
            request_deserializer=Transaction.FromString,
            response_serializer=Message.SerializeToString,
        ),
        'TransactionFrom': grpc.unary_unary_rpc_method_handler(
            servicer.TransactionFrom,
            request_deserializer=Message.FromString,
            response_serializer=Transaction.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'Synchronization', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:deep_q    作者:tobegit3hub    | 项目源码 | 文件源码
def add_PredictionServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Predict': grpc.unary_unary_rpc_method_handler(
          servicer.Predict,
          request_deserializer=predict__pb2.PredictRequest.FromString,
          response_serializer=predict__pb2.PredictResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'tensorflow.serving.PredictionService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:gRPC-Makerboards    作者:PeridotYouClod    | 项目源码 | 文件源码
def add_WioLinkServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetLux': grpc.unary_unary_rpc_method_handler(
          servicer.GetLux,
          request_deserializer=GetLuxRequest.FromString,
          response_serializer=GetLuxReply.SerializeToString,
      ),
      'GetTemperature': grpc.unary_unary_rpc_method_handler(
          servicer.GetTemperature,
          request_deserializer=GetTemperatureRequest.FromString,
          response_serializer=GetTemperatureReply.SerializeToString,
      ),
      'GetSound': grpc.unary_unary_rpc_method_handler(
          servicer.GetSound,
          request_deserializer=GetSoundRequest.FromString,
          response_serializer=GetSoundReply.SerializeToString,
      ),
      'SetLedStrip': grpc.unary_unary_rpc_method_handler(
          servicer.SetLedStrip,
          request_deserializer=SetLedStripRequest.FromString,
          response_serializer=SetLedStripReply.SerializeToString,
      ),
      'GetButtonPressed': grpc.unary_unary_rpc_method_handler(
          servicer.GetButtonPressed,
          request_deserializer=GetButtonPressedRequest.FromString,
          response_serializer=GetButtonPressedReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'WioLink', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:relaax    作者:deeplearninc    | 项目源码 | 文件源码
def add_BridgeServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Init': grpc.unary_unary_rpc_method_handler(
            servicer.Init,
            request_deserializer=NullMessage.FromString,
            response_serializer=NullMessage.SerializeToString,
        ),
        'Run': grpc.stream_stream_rpc_method_handler(
            servicer.Run,
            request_deserializer=Item.FromString,
            response_serializer=Item.SerializeToString,
        ),
        'SetX': grpc.unary_unary_rpc_method_handler(
            servicer.SetX,
            request_deserializer=X.FromString,
            response_serializer=NullMessage.SerializeToString,
        ),
        'StoreMetric': grpc.stream_unary_rpc_method_handler(
            servicer.StoreMetric,
            request_deserializer=Item.FromString,
            response_serializer=NullMessage.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'Bridge', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:relaax    作者:deeplearninc    | 项目源码 | 文件源码
def add_BridgeServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Init': grpc.unary_unary_rpc_method_handler(
          servicer.Init,
          request_deserializer=bridge__pb2.NullMessage.FromString,
          response_serializer=bridge__pb2.NullMessage.SerializeToString,
      ),
      'Run': grpc.stream_stream_rpc_method_handler(
          servicer.Run,
          request_deserializer=bridge__pb2.Item.FromString,
          response_serializer=bridge__pb2.Item.SerializeToString,
      ),
      'SetX': grpc.unary_unary_rpc_method_handler(
          servicer.SetX,
          request_deserializer=bridge__pb2.X.FromString,
          response_serializer=bridge__pb2.NullMessage.SerializeToString,
      ),
      'StoreMetric': grpc.stream_unary_rpc_method_handler(
          servicer.StoreMetric,
          request_deserializer=bridge__pb2.Item.FromString,
          response_serializer=bridge__pb2.NullMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Bridge', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:CommunityCellularManager    作者:facebookincubator    | 项目源码 | 文件源码
def add_SubscriberDBServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'AddSubscriber': grpc.unary_unary_rpc_method_handler(
            servicer.AddSubscriber,
            request_deserializer=SubscriberData.FromString,
            response_serializer=Void.SerializeToString,
        ),
        'DeleteSubscriber': grpc.unary_unary_rpc_method_handler(
            servicer.DeleteSubscriber,
            request_deserializer=SubscriberID.FromString,
            response_serializer=Void.SerializeToString,
        ),
        'UpdateSubscriber': grpc.unary_unary_rpc_method_handler(
            servicer.UpdateSubscriber,
            request_deserializer=SubscriberUpdate.FromString,
            response_serializer=Void.SerializeToString,
        ),
        'GetSubscriberData': grpc.unary_unary_rpc_method_handler(
            servicer.GetSubscriberData,
            request_deserializer=SubscriberID.FromString,
            response_serializer=SubscriberData.SerializeToString,
        ),
        'ListSubscribers': grpc.unary_unary_rpc_method_handler(
            servicer.ListSubscribers,
            request_deserializer=Void.FromString,
            response_serializer=SubscriberIDSet.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'osmocom.SubscriberDB', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:CommunityCellularManager    作者:facebookincubator    | 项目源码 | 文件源码
def add_SubscriberDBServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'AddSubscriber': grpc.unary_unary_rpc_method_handler(
          servicer.AddSubscriber,
          request_deserializer=subscriber__pb2.SubscriberData.FromString,
          response_serializer=subscriber__pb2.Void.SerializeToString,
      ),
      'DeleteSubscriber': grpc.unary_unary_rpc_method_handler(
          servicer.DeleteSubscriber,
          request_deserializer=subscriber__pb2.SubscriberID.FromString,
          response_serializer=subscriber__pb2.Void.SerializeToString,
      ),
      'UpdateSubscriber': grpc.unary_unary_rpc_method_handler(
          servicer.UpdateSubscriber,
          request_deserializer=subscriber__pb2.SubscriberUpdate.FromString,
          response_serializer=subscriber__pb2.Void.SerializeToString,
      ),
      'GetSubscriberData': grpc.unary_unary_rpc_method_handler(
          servicer.GetSubscriberData,
          request_deserializer=subscriber__pb2.SubscriberID.FromString,
          response_serializer=subscriber__pb2.SubscriberData.SerializeToString,
      ),
      'ListSubscribers': grpc.unary_unary_rpc_method_handler(
          servicer.ListSubscribers,
          request_deserializer=subscriber__pb2.Void.FromString,
          response_serializer=subscriber__pb2.SubscriberIDSet.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'osmocom.SubscriberDB', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:snap-plugin-lib-py    作者:intelsdi-x    | 项目源码 | 文件源码
def add_CollectorServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'CollectMetrics': grpc.unary_unary_rpc_method_handler(
            servicer.CollectMetrics,
            request_deserializer=MetricsArg.FromString,
            response_serializer=MetricsReply.SerializeToString,
        ),
        'GetMetricTypes': grpc.unary_unary_rpc_method_handler(
            servicer.GetMetricTypes,
            request_deserializer=GetMetricTypesArg.FromString,
            response_serializer=MetricsReply.SerializeToString,
        ),
        'Ping': grpc.unary_unary_rpc_method_handler(
            servicer.Ping,
            request_deserializer=Empty.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'Kill': grpc.unary_unary_rpc_method_handler(
            servicer.Kill,
            request_deserializer=KillArg.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'GetConfigPolicy': grpc.unary_unary_rpc_method_handler(
            servicer.GetConfigPolicy,
            request_deserializer=Empty.FromString,
            response_serializer=GetConfigPolicyReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'rpc.Collector', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:snap-plugin-lib-py    作者:intelsdi-x    | 项目源码 | 文件源码
def add_ProcessorServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Process': grpc.unary_unary_rpc_method_handler(
            servicer.Process,
            request_deserializer=PubProcArg.FromString,
            response_serializer=MetricsReply.SerializeToString,
        ),
        'Ping': grpc.unary_unary_rpc_method_handler(
            servicer.Ping,
            request_deserializer=Empty.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'Kill': grpc.unary_unary_rpc_method_handler(
            servicer.Kill,
            request_deserializer=KillArg.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'GetConfigPolicy': grpc.unary_unary_rpc_method_handler(
            servicer.GetConfigPolicy,
            request_deserializer=Empty.FromString,
            response_serializer=GetConfigPolicyReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'rpc.Processor', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:snap-plugin-lib-py    作者:intelsdi-x    | 项目源码 | 文件源码
def add_PublisherServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Publish': grpc.unary_unary_rpc_method_handler(
            servicer.Publish,
            request_deserializer=PubProcArg.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'Ping': grpc.unary_unary_rpc_method_handler(
            servicer.Ping,
            request_deserializer=Empty.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'Kill': grpc.unary_unary_rpc_method_handler(
            servicer.Kill,
            request_deserializer=KillArg.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'GetConfigPolicy': grpc.unary_unary_rpc_method_handler(
            servicer.GetConfigPolicy,
            request_deserializer=Empty.FromString,
            response_serializer=GetConfigPolicyReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'rpc.Publisher', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:snap-plugin-lib-py    作者:intelsdi-x    | 项目源码 | 文件源码
def add_StreamCollectorServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'StreamMetrics': grpc.stream_stream_rpc_method_handler(
            servicer.StreamMetrics,
            request_deserializer=CollectArg.FromString,
            response_serializer=CollectReply.SerializeToString,
        ),
        'GetMetricTypes': grpc.unary_unary_rpc_method_handler(
            servicer.GetMetricTypes,
            request_deserializer=GetMetricTypesArg.FromString,
            response_serializer=MetricsReply.SerializeToString,
        ),
        'Ping': grpc.unary_unary_rpc_method_handler(
            servicer.Ping,
            request_deserializer=Empty.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'Kill': grpc.unary_unary_rpc_method_handler(
            servicer.Kill,
            request_deserializer=KillArg.FromString,
            response_serializer=ErrReply.SerializeToString,
        ),
        'GetConfigPolicy': grpc.unary_unary_rpc_method_handler(
            servicer.GetConfigPolicy,
            request_deserializer=Empty.FromString,
            response_serializer=GetConfigPolicyReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'rpc.StreamCollector', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:python-etcd3    作者:kragniz    | 项目源码 | 文件源码
def add_KVServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Range': grpc.unary_unary_rpc_method_handler(
            servicer.Range,
            request_deserializer=RangeRequest.FromString,
            response_serializer=RangeResponse.SerializeToString,
        ),
        'Put': grpc.unary_unary_rpc_method_handler(
            servicer.Put,
            request_deserializer=PutRequest.FromString,
            response_serializer=PutResponse.SerializeToString,
        ),
        'DeleteRange': grpc.unary_unary_rpc_method_handler(
            servicer.DeleteRange,
            request_deserializer=DeleteRangeRequest.FromString,
            response_serializer=DeleteRangeResponse.SerializeToString,
        ),
        'Txn': grpc.unary_unary_rpc_method_handler(
            servicer.Txn,
            request_deserializer=TxnRequest.FromString,
            response_serializer=TxnResponse.SerializeToString,
        ),
        'Compact': grpc.unary_unary_rpc_method_handler(
            servicer.Compact,
            request_deserializer=CompactionRequest.FromString,
            response_serializer=CompactionResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'etcdserverpb.KV', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:python-etcd3    作者:kragniz    | 项目源码 | 文件源码
def add_LeaseServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'LeaseGrant': grpc.unary_unary_rpc_method_handler(
            servicer.LeaseGrant,
            request_deserializer=LeaseGrantRequest.FromString,
            response_serializer=LeaseGrantResponse.SerializeToString,
        ),
        'LeaseRevoke': grpc.unary_unary_rpc_method_handler(
            servicer.LeaseRevoke,
            request_deserializer=LeaseRevokeRequest.FromString,
            response_serializer=LeaseRevokeResponse.SerializeToString,
        ),
        'LeaseKeepAlive': grpc.stream_stream_rpc_method_handler(
            servicer.LeaseKeepAlive,
            request_deserializer=LeaseKeepAliveRequest.FromString,
            response_serializer=LeaseKeepAliveResponse.SerializeToString,
        ),
        'LeaseTimeToLive': grpc.unary_unary_rpc_method_handler(
            servicer.LeaseTimeToLive,
            request_deserializer=LeaseTimeToLiveRequest.FromString,
            response_serializer=LeaseTimeToLiveResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'etcdserverpb.Lease', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:python-etcd3    作者:kragniz    | 项目源码 | 文件源码
def add_ClusterServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'MemberAdd': grpc.unary_unary_rpc_method_handler(
            servicer.MemberAdd,
            request_deserializer=MemberAddRequest.FromString,
            response_serializer=MemberAddResponse.SerializeToString,
        ),
        'MemberRemove': grpc.unary_unary_rpc_method_handler(
            servicer.MemberRemove,
            request_deserializer=MemberRemoveRequest.FromString,
            response_serializer=MemberRemoveResponse.SerializeToString,
        ),
        'MemberUpdate': grpc.unary_unary_rpc_method_handler(
            servicer.MemberUpdate,
            request_deserializer=MemberUpdateRequest.FromString,
            response_serializer=MemberUpdateResponse.SerializeToString,
        ),
        'MemberList': grpc.unary_unary_rpc_method_handler(
            servicer.MemberList,
            request_deserializer=MemberListRequest.FromString,
            response_serializer=MemberListResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'etcdserverpb.Cluster', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:python-etcd3    作者:kragniz    | 项目源码 | 文件源码
def add_MaintenanceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Alarm': grpc.unary_unary_rpc_method_handler(
            servicer.Alarm,
            request_deserializer=AlarmRequest.FromString,
            response_serializer=AlarmResponse.SerializeToString,
        ),
        'Status': grpc.unary_unary_rpc_method_handler(
            servicer.Status,
            request_deserializer=StatusRequest.FromString,
            response_serializer=StatusResponse.SerializeToString,
        ),
        'Defragment': grpc.unary_unary_rpc_method_handler(
            servicer.Defragment,
            request_deserializer=DefragmentRequest.FromString,
            response_serializer=DefragmentResponse.SerializeToString,
        ),
        'Hash': grpc.unary_unary_rpc_method_handler(
            servicer.Hash,
            request_deserializer=HashRequest.FromString,
            response_serializer=HashResponse.SerializeToString,
        ),
        'Snapshot': grpc.unary_stream_rpc_method_handler(
            servicer.Snapshot,
            request_deserializer=SnapshotRequest.FromString,
            response_serializer=SnapshotResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'etcdserverpb.Maintenance', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:loopchain    作者:theloopkr    | 项目源码 | 文件源码
def add_AdminServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Request': grpc.unary_unary_rpc_method_handler(
            servicer.Request,
            request_deserializer=Message.FromString,
            response_serializer=Message.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'AdminService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:loopchain    作者:theloopkr    | 项目源码 | 文件源码
def add_ContainerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Request': grpc.unary_unary_rpc_method_handler(
            servicer.Request,
            request_deserializer=Message.FromString,
            response_serializer=Message.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'Container', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:loopchain    作者:theloopkr    | 项目源码 | 文件源码
def add_AdminServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Request': grpc.unary_unary_rpc_method_handler(
          servicer.Request,
          request_deserializer=loopchain__pb2.Message.FromString,
          response_serializer=loopchain__pb2.Message.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'AdminService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:loopchain    作者:theloopkr    | 项目源码 | 文件源码
def add_ContainerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Request': grpc.unary_unary_rpc_method_handler(
          servicer.Request,
          request_deserializer=loopchain__pb2.Message.FromString,
          response_serializer=loopchain__pb2.Message.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'Container', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))