Python grpc.beta.implementations.server() Examples

The following are 30 code examples of grpc.beta.implementations.server(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module grpc.beta.implementations , or try the search function .
Example #1
Source File: calculator_pb2.py    From basic-grpc-python with MIT License 6 votes vote down vote up
def beta_create_Calculator_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('Calculator', 'SquareRoot'): Number.FromString,
    }
    response_serializers = {
      ('Calculator', 'SquareRoot'): Number.SerializeToString,
    }
    method_implementations = {
      ('Calculator', 'SquareRoot'): face_utilities.unary_unary_inline(servicer.SquareRoot),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #2
Source File: actions_pb2.py    From marvin-python-toolbox with Apache License 2.0 6 votes vote down vote up
def beta_create_OnlineActionHandler_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('OnlineActionHandler', '_health_check'): HealthCheckRequest.FromString,
      ('OnlineActionHandler', '_remote_execute'): OnlineActionRequest.FromString,
      ('OnlineActionHandler', '_remote_reload'): ReloadRequest.FromString,
    }
    response_serializers = {
      ('OnlineActionHandler', '_health_check'): HealthCheckResponse.SerializeToString,
      ('OnlineActionHandler', '_remote_execute'): OnlineActionResponse.SerializeToString,
      ('OnlineActionHandler', '_remote_reload'): ReloadResponse.SerializeToString,
    }
    method_implementations = {
      ('OnlineActionHandler', '_health_check'): face_utilities.unary_unary_inline(servicer._health_check),
      ('OnlineActionHandler', '_remote_execute'): face_utilities.unary_unary_inline(servicer._remote_execute),
      ('OnlineActionHandler', '_remote_reload'): face_utilities.unary_unary_inline(servicer._remote_reload),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #3
Source File: worldhello_pb2.py    From sea with MIT License 6 votes vote down vote up
def add_GreeterServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'SayHello': grpc.unary_unary_rpc_method_handler(
            servicer.SayHello,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloReply.SerializeToString,
        ),
        'SayHelloAgain': grpc.unary_unary_rpc_method_handler(
            servicer.SayHelloAgain,
            request_deserializer=HelloRequest.FromString,
            response_serializer=HelloReply.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'worldhello.Greeter', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #4
Source File: worldhello_pb2.py    From sea with MIT License 6 votes vote down vote up
def beta_create_Greeter_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('worldhello.Greeter', 'SayHello'): HelloRequest.FromString,
      ('worldhello.Greeter', 'SayHelloAgain'): HelloRequest.FromString,
    }
    response_serializers = {
      ('worldhello.Greeter', 'SayHello'): HelloReply.SerializeToString,
      ('worldhello.Greeter', 'SayHelloAgain'): HelloReply.SerializeToString,
    }
    method_implementations = {
      ('worldhello.Greeter', 'SayHello'): face_utilities.unary_unary_inline(servicer.SayHello),
      ('worldhello.Greeter', 'SayHelloAgain'): face_utilities.unary_unary_inline(servicer.SayHelloAgain),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #5
Source File: actions_pb2.py    From marvin-python-toolbox with Apache License 2.0 6 votes vote down vote up
def add_OnlineActionHandlerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        '_remote_execute': grpc.unary_unary_rpc_method_handler(
            servicer._remote_execute,
            request_deserializer=OnlineActionRequest.FromString,
            response_serializer=OnlineActionResponse.SerializeToString,
        ),
        '_remote_reload': grpc.unary_unary_rpc_method_handler(
            servicer._remote_reload,
            request_deserializer=ReloadRequest.FromString,
            response_serializer=ReloadResponse.SerializeToString,
        ),
        '_health_check': grpc.unary_unary_rpc_method_handler(
            servicer._health_check,
            request_deserializer=HealthCheckRequest.FromString,
            response_serializer=HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'OnlineActionHandler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #6
Source File: prediction_service_pb2.py    From text-antispam with MIT License 6 votes vote down vote up
def beta_create_PredictionService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('tensorflow.serving.PredictionService', 'Predict'): predict__pb2.PredictRequest.FromString,
    }
    response_serializers = {
      ('tensorflow.serving.PredictionService', 'Predict'): predict__pb2.PredictResponse.SerializeToString,
    }
    method_implementations = {
      ('tensorflow.serving.PredictionService', 'Predict'): face_utilities.unary_unary_inline(servicer.Predict),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #7
Source File: helloworld_pb2.py    From sea with MIT License 6 votes vote down vote up
def beta_create_Greeter_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('helloworld.Greeter', 'SayHello'): HelloRequest.FromString,
    }
    response_serializers = {
      ('helloworld.Greeter', 'SayHello'): HelloReply.SerializeToString,
    }
    method_implementations = {
      ('helloworld.Greeter', 'SayHello'): face_utilities.unary_unary_inline(servicer.SayHello),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #8
Source File: actions_pb2.py    From marvin-python-toolbox with Apache License 2.0 6 votes vote down vote up
def add_BatchActionHandlerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        '_remote_execute': grpc.unary_unary_rpc_method_handler(
            servicer._remote_execute,
            request_deserializer=BatchActionRequest.FromString,
            response_serializer=BatchActionResponse.SerializeToString,
        ),
        '_remote_reload': grpc.unary_unary_rpc_method_handler(
            servicer._remote_reload,
            request_deserializer=ReloadRequest.FromString,
            response_serializer=ReloadResponse.SerializeToString,
        ),
        '_health_check': grpc.unary_unary_rpc_method_handler(
            servicer._health_check,
            request_deserializer=HealthCheckRequest.FromString,
            response_serializer=HealthCheckResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'BatchActionHandler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #9
Source File: clusterspecgenerator_pb2.py    From hops-tensorflow with Apache License 2.0 6 votes vote down vote up
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,)) 
Example #10
Source File: clusterspecgenerator_pb2.py    From hops-tensorflow with Apache License 2.0 6 votes vote down vote up
def beta_create_ClusterSpecGenerator_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('clusterspecgenerator.ClusterSpecGenerator', 'GetClusterSpec'): GetClusterSpecRequest.FromString,
      ('clusterspecgenerator.ClusterSpecGenerator', 'RegisterContainer'): RegisterContainerRequest.FromString,
    }
    response_serializers = {
      ('clusterspecgenerator.ClusterSpecGenerator', 'GetClusterSpec'): GetClusterSpecReply.SerializeToString,
      ('clusterspecgenerator.ClusterSpecGenerator', 'RegisterContainer'): RegisterContainerReply.SerializeToString,
    }
    method_implementations = {
      ('clusterspecgenerator.ClusterSpecGenerator', 'GetClusterSpec'): face_utilities.unary_unary_inline(servicer.GetClusterSpec),
      ('clusterspecgenerator.ClusterSpecGenerator', 'RegisterContainer'): face_utilities.unary_unary_inline(servicer.RegisterContainer),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #11
Source File: command_line_pb2.py    From python-grpc with Apache License 2.0 6 votes vote down vote up
def beta_create_CommandLine_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('command_line.CommandLine', 'Echo'): CommandRequest.FromString,
    }
    response_serializers = {
      ('command_line.CommandLine', 'Echo'): CommandResponse.SerializeToString,
    }
    method_implementations = {
      ('command_line.CommandLine', 'Echo'): face_utilities.unary_unary_inline(servicer.Echo),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #12
Source File: command_line_pb2.py    From python-grpc with Apache License 2.0 6 votes vote down vote up
def beta_create_CommandLine_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('command_line.CommandLine', 'Echo'): CommandRequest.FromString,
    }
    response_serializers = {
      ('command_line.CommandLine', 'Echo'): CommandResponse.SerializeToString,
    }
    method_implementations = {
      ('command_line.CommandLine', 'Echo'): face_utilities.unary_unary_inline(servicer.Echo),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #13
Source File: Health_pb2.py    From predixpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def beta_create_Health_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('grpc.health.v1.Health', 'Check'): HealthCheckRequest.FromString,
    }
    response_serializers = {
      ('grpc.health.v1.Health', 'Check'): HealthCheckResponse.SerializeToString,
    }
    method_implementations = {
      ('grpc.health.v1.Health', 'Check'): face_utilities.unary_unary_inline(servicer.Check),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #14
Source File: EventHub_pb2.py    From predixpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def add_SubscriberServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'receive': grpc.unary_stream_rpc_method_handler(
            servicer.receive,
            request_deserializer=SubscriptionRequest.FromString,
            response_serializer=Message.SerializeToString,
        ),
        'receiveWithAcks': grpc.stream_stream_rpc_method_handler(
            servicer.receiveWithAcks,
            request_deserializer=SubscriptionResponse.FromString,
            response_serializer=Message.SerializeToString,
        ),
        'subscribe': grpc.stream_stream_rpc_method_handler(
            servicer.subscribe,
            request_deserializer=SubscriptionAcks.FromString,
            response_serializer=SubscriptionMessage.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'predix.eventhub.Subscriber', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #15
Source File: EventHub_pb2.py    From predixpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def beta_create_Publisher_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('predix.eventhub.Publisher', 'send'): PublishRequest.FromString,
    }
    response_serializers = {
      ('predix.eventhub.Publisher', 'send'): PublishResponse.SerializeToString,
    }
    method_implementations = {
      ('predix.eventhub.Publisher', 'send'): face_utilities.stream_stream_inline(servicer.send),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #16
Source File: prediction_service_pb2.py    From Make_Money_with_Tensorflow with GNU General Public License v3.0 6 votes vote down vote up
def beta_create_PredictionService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('tensorflow.serving.PredictionService', 'Predict'): PredictRequest.FromString,
    }
    response_serializers = {
      ('tensorflow.serving.PredictionService', 'Predict'): PredictResponse.SerializeToString,
    }
    method_implementations = {
      ('tensorflow.serving.PredictionService', 'Predict'): face_utilities.unary_unary_inline(servicer.Predict),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #17
Source File: ServerSideExtension_pb2.py    From qlik-py-tools with MIT License 6 votes vote down vote up
def add_ConnectorServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GetCapabilities': grpc.unary_unary_rpc_method_handler(
            servicer.GetCapabilities,
            request_deserializer=Empty.FromString,
            response_serializer=Capabilities.SerializeToString,
        ),
        'ExecuteFunction': grpc.stream_stream_rpc_method_handler(
            servicer.ExecuteFunction,
            request_deserializer=BundledRows.FromString,
            response_serializer=BundledRows.SerializeToString,
        ),
        'EvaluateScript': grpc.stream_stream_rpc_method_handler(
            servicer.EvaluateScript,
            request_deserializer=BundledRows.FromString,
            response_serializer=BundledRows.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'qlik.sse.Connector', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #18
Source File: ServerSideExtension_pb2.py    From qlik-py-tools with MIT License 6 votes vote down vote up
def beta_create_Connector_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('qlik.sse.Connector', 'EvaluateScript'): BundledRows.FromString,
      ('qlik.sse.Connector', 'ExecuteFunction'): BundledRows.FromString,
      ('qlik.sse.Connector', 'GetCapabilities'): Empty.FromString,
    }
    response_serializers = {
      ('qlik.sse.Connector', 'EvaluateScript'): BundledRows.SerializeToString,
      ('qlik.sse.Connector', 'ExecuteFunction'): BundledRows.SerializeToString,
      ('qlik.sse.Connector', 'GetCapabilities'): Capabilities.SerializeToString,
    }
    method_implementations = {
      ('qlik.sse.Connector', 'EvaluateScript'): face_utilities.stream_stream_inline(servicer.EvaluateScript),
      ('qlik.sse.Connector', 'ExecuteFunction'): face_utilities.stream_stream_inline(servicer.ExecuteFunction),
      ('qlik.sse.Connector', 'GetCapabilities'): face_utilities.unary_unary_inline(servicer.GetCapabilities),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #19
Source File: networkserver_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def beta_create_NetworkServerManager_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('networkserver.NetworkServerManager', 'GetStatus'): StatusRequest.FromString,
    }
    response_serializers = {
      ('networkserver.NetworkServerManager', 'GetStatus'): Status.SerializeToString,
    }
    method_implementations = {
      ('networkserver.NetworkServerManager', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #20
Source File: device_address_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def add_DevAddrManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GetPrefixes': grpc.unary_unary_rpc_method_handler(
            servicer.GetPrefixes,
            request_deserializer=PrefixesRequest.FromString,
            response_serializer=PrefixesResponse.SerializeToString,
        ),
        'GetDevAddr': grpc.unary_unary_rpc_method_handler(
            servicer.GetDevAddr,
            request_deserializer=DevAddrRequest.FromString,
            response_serializer=DevAddrResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'lorawan.DevAddrManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #21
Source File: device_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def add_DeviceManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GetDevice': grpc.unary_unary_rpc_method_handler(
            servicer.GetDevice,
            request_deserializer=DeviceIdentifier.FromString,
            response_serializer=Device.SerializeToString,
        ),
        'SetDevice': grpc.unary_unary_rpc_method_handler(
            servicer.SetDevice,
            request_deserializer=Device.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        'DeleteDevice': grpc.unary_unary_rpc_method_handler(
            servicer.DeleteDevice,
            request_deserializer=DeviceIdentifier.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'lorawan.DeviceManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #22
Source File: device_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def beta_create_DeviceManager_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('lorawan.DeviceManager', 'DeleteDevice'): DeviceIdentifier.FromString,
      ('lorawan.DeviceManager', 'GetDevice'): DeviceIdentifier.FromString,
      ('lorawan.DeviceManager', 'SetDevice'): Device.FromString,
    }
    response_serializers = {
      ('lorawan.DeviceManager', 'DeleteDevice'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ('lorawan.DeviceManager', 'GetDevice'): Device.SerializeToString,
      ('lorawan.DeviceManager', 'SetDevice'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
    }
    method_implementations = {
      ('lorawan.DeviceManager', 'DeleteDevice'): face_utilities.unary_unary_inline(servicer.DeleteDevice),
      ('lorawan.DeviceManager', 'GetDevice'): face_utilities.unary_unary_inline(servicer.GetDevice),
      ('lorawan.DeviceManager', 'SetDevice'): face_utilities.unary_unary_inline(servicer.SetDevice),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #23
Source File: handler_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def add_HandlerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'ActivationChallenge': grpc.unary_unary_rpc_method_handler(
            servicer.ActivationChallenge,
            request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.ActivationChallengeRequest.FromString,
            response_serializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.ActivationChallengeResponse.SerializeToString,
        ),
        'Activate': grpc.unary_unary_rpc_method_handler(
            servicer.Activate,
            request_deserializer=github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeduplicatedDeviceActivationRequest.FromString,
            response_serializer=DeviceActivationResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'handler.Handler', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #24
Source File: handler_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def beta_create_Handler_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('handler.Handler', 'Activate'): github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.DeduplicatedDeviceActivationRequest.FromString,
      ('handler.Handler', 'ActivationChallenge'): github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.ActivationChallengeRequest.FromString,
    }
    response_serializers = {
      ('handler.Handler', 'Activate'): DeviceActivationResponse.SerializeToString,
      ('handler.Handler', 'ActivationChallenge'): github__com_dot_TheThingsNetwork_dot_api_dot_broker_dot_broker__pb2.ActivationChallengeResponse.SerializeToString,
    }
    method_implementations = {
      ('handler.Handler', 'Activate'): face_utilities.unary_unary_inline(servicer.Activate),
      ('handler.Handler', 'ActivationChallenge'): face_utilities.unary_unary_inline(servicer.ActivationChallenge),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #25
Source File: handler_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def beta_create_HandlerManager_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('handler.HandlerManager', 'GetStatus'): StatusRequest.FromString,
    }
    response_serializers = {
      ('handler.HandlerManager', 'GetStatus'): Status.SerializeToString,
    }
    method_implementations = {
      ('handler.HandlerManager', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #26
Source File: broker_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def add_BrokerManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'RegisterApplicationHandler': grpc.unary_unary_rpc_method_handler(
            servicer.RegisterApplicationHandler,
            request_deserializer=ApplicationHandlerRegistration.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        'GetStatus': grpc.unary_unary_rpc_method_handler(
            servicer.GetStatus,
            request_deserializer=StatusRequest.FromString,
            response_serializer=Status.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'broker.BrokerManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #27
Source File: broker_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def beta_create_BrokerManager_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('broker.BrokerManager', 'GetStatus'): StatusRequest.FromString,
      ('broker.BrokerManager', 'RegisterApplicationHandler'): ApplicationHandlerRegistration.FromString,
    }
    response_serializers = {
      ('broker.BrokerManager', 'GetStatus'): Status.SerializeToString,
      ('broker.BrokerManager', 'RegisterApplicationHandler'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
    }
    method_implementations = {
      ('broker.BrokerManager', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus),
      ('broker.BrokerManager', 'RegisterApplicationHandler'): face_utilities.unary_unary_inline(servicer.RegisterApplicationHandler),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #28
Source File: router_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def add_RouterManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        'GatewayStatus': grpc.unary_unary_rpc_method_handler(
            servicer.GatewayStatus,
            request_deserializer=GatewayStatusRequest.FromString,
            response_serializer=GatewayStatusResponse.SerializeToString,
        ),
        'GetStatus': grpc.unary_unary_rpc_method_handler(
            servicer.GetStatus,
            request_deserializer=StatusRequest.FromString,
            response_serializer=Status.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        'router.RouterManager', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,)) 
Example #29
Source File: router_pb2.py    From python-app-sdk with MIT License 6 votes vote down vote up
def beta_create_RouterManager_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('router.RouterManager', 'GatewayStatus'): GatewayStatusRequest.FromString,
      ('router.RouterManager', 'GetStatus'): StatusRequest.FromString,
    }
    response_serializers = {
      ('router.RouterManager', 'GatewayStatus'): GatewayStatusResponse.SerializeToString,
      ('router.RouterManager', 'GetStatus'): Status.SerializeToString,
    }
    method_implementations = {
      ('router.RouterManager', 'GatewayStatus'): face_utilities.unary_unary_inline(servicer.GatewayStatus),
      ('router.RouterManager', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options) 
Example #30
Source File: grpc_service_pb2.py    From python-compat-runtime with Apache License 2.0 6 votes vote down vote up
def beta_create_CallHandler_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('apphosting.tools.devappserver2.CallHandler', 'HandleCall'): Request.FromString,
    }
    response_serializers = {
      ('apphosting.tools.devappserver2.CallHandler', 'HandleCall'): Response.SerializeToString,
    }
    method_implementations = {
      ('apphosting.tools.devappserver2.CallHandler', 'HandleCall'): face_utilities.unary_unary_inline(servicer.HandleCall),
    }
    server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
    return beta_implementations.server(method_implementations, options=server_options)