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

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

项目:ios-xr-grpc-python    作者:cisco-grpc-connection-libs    | 项目源码 | 文件源码
def add_gRPCExecServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ShowCmdTextOutput': grpc.unary_stream_rpc_method_handler(
          servicer.ShowCmdTextOutput,
          request_deserializer=ShowCmdArgs.FromString,
          response_serializer=ShowCmdTextReply.SerializeToString,
      ),
      'ShowCmdJSONOutput': grpc.unary_stream_rpc_method_handler(
          servicer.ShowCmdJSONOutput,
          request_deserializer=ShowCmdArgs.FromString,
          response_serializer=ShowCmdJSONReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'IOSXRExtensibleManagabilityService.gRPCExec', 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_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,))
项目:thegame    作者:afg984    | 项目源码 | 文件源码
def add_TheGameServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Game': grpc.stream_stream_rpc_method_handler(
          servicer.Game,
          request_deserializer=thegame_dot_thegame__pb2.Controls.FromString,
          response_serializer=thegame_dot_thegame__pb2.GameState.SerializeToString,
      ),
      'View': grpc.unary_stream_rpc_method_handler(
          servicer.View,
          request_deserializer=thegame_dot_thegame__pb2.ViewRequest.FromString,
          response_serializer=thegame_dot_thegame__pb2.GameState.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'TheGame', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:thegame    作者:afg984    | 项目源码 | 文件源码
def add_TheGameServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'Game': grpc.stream_stream_rpc_method_handler(
            servicer.Game,
            request_deserializer=Controls.FromString,
            response_serializer=GameState.SerializeToString,
        ),
        'View': grpc.unary_stream_rpc_method_handler(
            servicer.View,
            request_deserializer=ViewRequest.FromString,
            response_serializer=GameState.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'TheGame', 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,))
项目: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,))
项目: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,))
项目:aioetcd3    作者:gaopeiliang    | 项目源码 | 文件源码
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,
        ),
        'HashKV': grpc.unary_unary_rpc_method_handler(
            servicer.HashKV,
            request_deserializer=HashKVRequest.FromString,
            response_serializer=HashKVResponse.SerializeToString,
        ),
        'Snapshot': grpc.unary_stream_rpc_method_handler(
            servicer.Snapshot,
            request_deserializer=SnapshotRequest.FromString,
            response_serializer=SnapshotResponse.SerializeToString,
        ),
        'MoveLeader': grpc.unary_unary_rpc_method_handler(
            servicer.MoveLeader,
            request_deserializer=MoveLeaderRequest.FromString,
            response_serializer=MoveLeaderResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'etcdserverpb.Maintenance', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:aioetcd3    作者:gaopeiliang    | 项目源码 | 文件源码
def add_MaintenanceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Alarm': grpc.unary_unary_rpc_method_handler(
          servicer.Alarm,
          request_deserializer=rpc__pb2.AlarmRequest.FromString,
          response_serializer=rpc__pb2.AlarmResponse.SerializeToString,
      ),
      'Status': grpc.unary_unary_rpc_method_handler(
          servicer.Status,
          request_deserializer=rpc__pb2.StatusRequest.FromString,
          response_serializer=rpc__pb2.StatusResponse.SerializeToString,
      ),
      'Defragment': grpc.unary_unary_rpc_method_handler(
          servicer.Defragment,
          request_deserializer=rpc__pb2.DefragmentRequest.FromString,
          response_serializer=rpc__pb2.DefragmentResponse.SerializeToString,
      ),
      'Hash': grpc.unary_unary_rpc_method_handler(
          servicer.Hash,
          request_deserializer=rpc__pb2.HashRequest.FromString,
          response_serializer=rpc__pb2.HashResponse.SerializeToString,
      ),
      'HashKV': grpc.unary_unary_rpc_method_handler(
          servicer.HashKV,
          request_deserializer=rpc__pb2.HashKVRequest.FromString,
          response_serializer=rpc__pb2.HashKVResponse.SerializeToString,
      ),
      'Snapshot': grpc.unary_stream_rpc_method_handler(
          servicer.Snapshot,
          request_deserializer=rpc__pb2.SnapshotRequest.FromString,
          response_serializer=rpc__pb2.SnapshotResponse.SerializeToString,
      ),
      'MoveLeader': grpc.unary_unary_rpc_method_handler(
          servicer.MoveLeader,
          request_deserializer=rpc__pb2.MoveLeaderRequest.FromString,
          response_serializer=rpc__pb2.MoveLeaderResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'etcdserverpb.Maintenance', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:grpc-opentracing    作者:grpc-ecosystem    | 项目源码 | 文件源码
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,))
项目:grpc-opentracing    作者:grpc-ecosystem    | 项目源码 | 文件源码
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,))
项目:quant    作者:yutiansut    | 项目源码 | 文件源码
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,))
项目:quant    作者:yutiansut    | 项目源码 | 文件源码
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,))
项目:skynet    作者:skynetera    | 项目源码 | 文件源码
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,))
项目:smartbox    作者:perfalle    | 项目源码 | 文件源码
def add_PublicAPIServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetInfo': grpc.unary_unary_rpc_method_handler(
          servicer.GetInfo,
          request_deserializer=api__pb2.GetInfoRequest.FromString,
          response_serializer=api__pb2.GetInfoResponse.SerializeToString,
      ),
      'ListPods': grpc.unary_unary_rpc_method_handler(
          servicer.ListPods,
          request_deserializer=api__pb2.ListPodsRequest.FromString,
          response_serializer=api__pb2.ListPodsResponse.SerializeToString,
      ),
      'InspectPod': grpc.unary_unary_rpc_method_handler(
          servicer.InspectPod,
          request_deserializer=api__pb2.InspectPodRequest.FromString,
          response_serializer=api__pb2.InspectPodResponse.SerializeToString,
      ),
      'ListImages': grpc.unary_unary_rpc_method_handler(
          servicer.ListImages,
          request_deserializer=api__pb2.ListImagesRequest.FromString,
          response_serializer=api__pb2.ListImagesResponse.SerializeToString,
      ),
      'InspectImage': grpc.unary_unary_rpc_method_handler(
          servicer.InspectImage,
          request_deserializer=api__pb2.InspectImageRequest.FromString,
          response_serializer=api__pb2.InspectImageResponse.SerializeToString,
      ),
      'ListenEvents': grpc.unary_stream_rpc_method_handler(
          servicer.ListenEvents,
          request_deserializer=api__pb2.ListenEventsRequest.FromString,
          response_serializer=api__pb2.ListenEventsResponse.SerializeToString,
      ),
      'GetLogs': grpc.unary_stream_rpc_method_handler(
          servicer.GetLogs,
          request_deserializer=api__pb2.GetLogsRequest.FromString,
          response_serializer=api__pb2.GetLogsResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'v1alpha.PublicAPI', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:smartbox    作者:perfalle    | 项目源码 | 文件源码
def add_PublicAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GetInfo': grpc.unary_unary_rpc_method_handler(
            servicer.GetInfo,
            request_deserializer=GetInfoRequest.FromString,
            response_serializer=GetInfoResponse.SerializeToString,
        ),
        'ListPods': grpc.unary_unary_rpc_method_handler(
            servicer.ListPods,
            request_deserializer=ListPodsRequest.FromString,
            response_serializer=ListPodsResponse.SerializeToString,
        ),
        'InspectPod': grpc.unary_unary_rpc_method_handler(
            servicer.InspectPod,
            request_deserializer=InspectPodRequest.FromString,
            response_serializer=InspectPodResponse.SerializeToString,
        ),
        'ListImages': grpc.unary_unary_rpc_method_handler(
            servicer.ListImages,
            request_deserializer=ListImagesRequest.FromString,
            response_serializer=ListImagesResponse.SerializeToString,
        ),
        'InspectImage': grpc.unary_unary_rpc_method_handler(
            servicer.InspectImage,
            request_deserializer=InspectImageRequest.FromString,
            response_serializer=InspectImageResponse.SerializeToString,
        ),
        'ListenEvents': grpc.unary_stream_rpc_method_handler(
            servicer.ListenEvents,
            request_deserializer=ListenEventsRequest.FromString,
            response_serializer=ListenEventsResponse.SerializeToString,
        ),
        'GetLogs': grpc.unary_stream_rpc_method_handler(
            servicer.GetLogs,
            request_deserializer=GetLogsRequest.FromString,
            response_serializer=GetLogsResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'v1alpha.PublicAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:nfd14-demo    作者:Juniper    | 项目源码 | 文件源码
def add_ManagementRpcApiServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ExecuteOpCommand': grpc.unary_stream_rpc_method_handler(
          servicer.ExecuteOpCommand,
          request_deserializer=ExecuteOpCommandRequest.FromString,
          response_serializer=ExecuteOpCommandResponse.SerializeToString,
      ),
      'ExecuteCfgCommand': grpc.unary_unary_rpc_method_handler(
          servicer.ExecuteCfgCommand,
          request_deserializer=ExecuteCfgCommandRequest.FromString,
          response_serializer=ExecuteCfgCommandResponse.SerializeToString,
      ),
      'GetEphemeralConfig': grpc.unary_unary_rpc_method_handler(
          servicer.GetEphemeralConfig,
          request_deserializer=GetEphemeralConfigRequest.FromString,
          response_serializer=GetEphemeralConfigResponse.SerializeToString,
      ),
      'EditEphemeralConfig': grpc.unary_unary_rpc_method_handler(
          servicer.EditEphemeralConfig,
          request_deserializer=EditEphemeralConfigRequest.FromString,
          response_serializer=EditEphemeralConfigResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'management.ManagementRpcApi', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:aiogrpc    作者:hubo1016    | 项目源码 | 文件源码
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,))
项目:aiogrpc    作者:hubo1016    | 项目源码 | 文件源码
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,))
项目:ios-xr-grpc-python    作者:cisco-grpc-connection-libs    | 项目源码 | 文件源码
def add_gRPCConfigOperServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetConfig': grpc.unary_stream_rpc_method_handler(
          servicer.GetConfig,
          request_deserializer=ConfigGetArgs.FromString,
          response_serializer=ConfigGetReply.SerializeToString,
      ),
      'MergeConfig': grpc.unary_unary_rpc_method_handler(
          servicer.MergeConfig,
          request_deserializer=ConfigArgs.FromString,
          response_serializer=ConfigReply.SerializeToString,
      ),
      'DeleteConfig': grpc.unary_unary_rpc_method_handler(
          servicer.DeleteConfig,
          request_deserializer=ConfigArgs.FromString,
          response_serializer=ConfigReply.SerializeToString,
      ),
      'ReplaceConfig': grpc.unary_unary_rpc_method_handler(
          servicer.ReplaceConfig,
          request_deserializer=ConfigArgs.FromString,
          response_serializer=ConfigReply.SerializeToString,
      ),
      'CliConfig': grpc.unary_unary_rpc_method_handler(
          servicer.CliConfig,
          request_deserializer=CliConfigArgs.FromString,
          response_serializer=CliConfigReply.SerializeToString,
      ),
      'CommitReplace': grpc.unary_unary_rpc_method_handler(
          servicer.CommitReplace,
          request_deserializer=CommitReplaceArgs.FromString,
          response_serializer=CommitReplaceReply.SerializeToString,
      ),
      'CommitConfig': grpc.unary_unary_rpc_method_handler(
          servicer.CommitConfig,
          request_deserializer=CommitArgs.FromString,
          response_serializer=CommitReply.SerializeToString,
      ),
      'ConfigDiscardChanges': grpc.unary_unary_rpc_method_handler(
          servicer.ConfigDiscardChanges,
          request_deserializer=DiscardChangesArgs.FromString,
          response_serializer=DiscardChangesReply.SerializeToString,
      ),
      'GetOper': grpc.unary_stream_rpc_method_handler(
          servicer.GetOper,
          request_deserializer=GetOperArgs.FromString,
          response_serializer=GetOperReply.SerializeToString,
      ),
      'CreateSubs': grpc.unary_stream_rpc_method_handler(
          servicer.CreateSubs,
          request_deserializer=CreateSubsArgs.FromString,
          response_serializer=CreateSubsReply.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'IOSXRExtensibleManagabilityService.gRPCConfigOper', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
项目:armada    作者:att-comdev    | 项目源码 | 文件源码
def add_ReleaseServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'ListReleases': grpc.unary_stream_rpc_method_handler(
            servicer.ListReleases,
            request_deserializer=ListReleasesRequest.FromString,
            response_serializer=ListReleasesResponse.SerializeToString,
        ),
        'GetReleaseStatus': grpc.unary_unary_rpc_method_handler(
            servicer.GetReleaseStatus,
            request_deserializer=GetReleaseStatusRequest.FromString,
            response_serializer=GetReleaseStatusResponse.SerializeToString,
        ),
        'GetReleaseContent': grpc.unary_unary_rpc_method_handler(
            servicer.GetReleaseContent,
            request_deserializer=GetReleaseContentRequest.FromString,
            response_serializer=GetReleaseContentResponse.SerializeToString,
        ),
        'UpdateRelease': grpc.unary_unary_rpc_method_handler(
            servicer.UpdateRelease,
            request_deserializer=UpdateReleaseRequest.FromString,
            response_serializer=UpdateReleaseResponse.SerializeToString,
        ),
        'InstallRelease': grpc.unary_unary_rpc_method_handler(
            servicer.InstallRelease,
            request_deserializer=InstallReleaseRequest.FromString,
            response_serializer=InstallReleaseResponse.SerializeToString,
        ),
        'UninstallRelease': grpc.unary_unary_rpc_method_handler(
            servicer.UninstallRelease,
            request_deserializer=UninstallReleaseRequest.FromString,
            response_serializer=UninstallReleaseResponse.SerializeToString,
        ),
        'GetVersion': grpc.unary_unary_rpc_method_handler(
            servicer.GetVersion,
            request_deserializer=GetVersionRequest.FromString,
            response_serializer=GetVersionResponse.SerializeToString,
        ),
        'RollbackRelease': grpc.unary_unary_rpc_method_handler(
            servicer.RollbackRelease,
            request_deserializer=RollbackReleaseRequest.FromString,
            response_serializer=RollbackReleaseResponse.SerializeToString,
        ),
        'GetHistory': grpc.unary_unary_rpc_method_handler(
            servicer.GetHistory,
            request_deserializer=GetHistoryRequest.FromString,
            response_serializer=GetHistoryResponse.SerializeToString,
        ),
        'RunReleaseTest': grpc.unary_stream_rpc_method_handler(
            servicer.RunReleaseTest,
            request_deserializer=TestReleaseRequest.FromString,
            response_serializer=TestReleaseResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'hapi.services.tiller.ReleaseService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
项目:armada    作者:att-comdev    | 项目源码 | 文件源码
def add_ReleaseServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ListReleases': grpc.unary_stream_rpc_method_handler(
          servicer.ListReleases,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.ListReleasesRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.ListReleasesResponse.SerializeToString,
      ),
      'GetReleaseStatus': grpc.unary_unary_rpc_method_handler(
          servicer.GetReleaseStatus,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.GetReleaseStatusRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.GetReleaseStatusResponse.SerializeToString,
      ),
      'GetReleaseContent': grpc.unary_unary_rpc_method_handler(
          servicer.GetReleaseContent,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.GetReleaseContentRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.GetReleaseContentResponse.SerializeToString,
      ),
      'UpdateRelease': grpc.unary_unary_rpc_method_handler(
          servicer.UpdateRelease,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.UpdateReleaseRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.UpdateReleaseResponse.SerializeToString,
      ),
      'InstallRelease': grpc.unary_unary_rpc_method_handler(
          servicer.InstallRelease,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.InstallReleaseRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.InstallReleaseResponse.SerializeToString,
      ),
      'UninstallRelease': grpc.unary_unary_rpc_method_handler(
          servicer.UninstallRelease,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.UninstallReleaseRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.UninstallReleaseResponse.SerializeToString,
      ),
      'GetVersion': grpc.unary_unary_rpc_method_handler(
          servicer.GetVersion,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.GetVersionRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.GetVersionResponse.SerializeToString,
      ),
      'RollbackRelease': grpc.unary_unary_rpc_method_handler(
          servicer.RollbackRelease,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.RollbackReleaseRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.RollbackReleaseResponse.SerializeToString,
      ),
      'GetHistory': grpc.unary_unary_rpc_method_handler(
          servicer.GetHistory,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.GetHistoryRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.GetHistoryResponse.SerializeToString,
      ),
      'RunReleaseTest': grpc.unary_stream_rpc_method_handler(
          servicer.RunReleaseTest,
          request_deserializer=hapi_dot_services_dot_tiller__pb2.TestReleaseRequest.FromString,
          response_serializer=hapi_dot_services_dot_tiller__pb2.TestReleaseResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'hapi.services.tiller.ReleaseService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))