本文整理汇总了Python中grpc.beta.implementations.server方法的典型用法代码示例。如果您正苦于以下问题:Python implementations.server方法的具体用法?Python implementations.server怎么用?Python implementations.server使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grpc.beta.implementations
的用法示例。
在下文中一共展示了implementations.server方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: beta_create_PredictionService_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例2: add_GreeterServicer_to_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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,))
示例3: beta_create_Greeter_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例4: beta_create_Greeter_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例5: beta_create_PredictionService_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例6: add_OnlineActionHandlerServicer_to_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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,))
示例7: add_BatchActionHandlerServicer_to_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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,))
示例8: beta_create_OnlineActionHandler_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例9: beta_create_BatchActionHandler_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
def beta_create_BatchActionHandler_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 = {
('BatchActionHandler', '_health_check'): HealthCheckRequest.FromString,
('BatchActionHandler', '_remote_execute'): BatchActionRequest.FromString,
('BatchActionHandler', '_remote_reload'): ReloadRequest.FromString,
}
response_serializers = {
('BatchActionHandler', '_health_check'): HealthCheckResponse.SerializeToString,
('BatchActionHandler', '_remote_execute'): BatchActionResponse.SerializeToString,
('BatchActionHandler', '_remote_reload'): ReloadResponse.SerializeToString,
}
method_implementations = {
('BatchActionHandler', '_health_check'): face_utilities.unary_unary_inline(servicer._health_check),
('BatchActionHandler', '_remote_execute'): face_utilities.unary_unary_inline(servicer._remote_execute),
('BatchActionHandler', '_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)
示例10: beta_create_ModelService_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
def beta_create_ModelService_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.ModelService', 'GetModelStatus'): tensorflow__serving_dot_apis_dot_get__model__status__pb2.GetModelStatusRequest.FromString,
}
response_serializers = {
('tensorflow.serving.ModelService', 'GetModelStatus'): tensorflow__serving_dot_apis_dot_get__model__status__pb2.GetModelStatusResponse.SerializeToString,
}
method_implementations = {
('tensorflow.serving.ModelService', 'GetModelStatus'): face_utilities.unary_unary_inline(servicer.GetModelStatus),
}
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)
示例11: add_ClusterSpecGeneratorServicer_to_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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,))
示例12: beta_create_ClusterSpecGenerator_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例13: beta_create_CommandLine_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例14: beta_create_Health_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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)
示例15: add_SubscriberServicer_to_server
# 需要导入模块: from grpc.beta import implementations [as 别名]
# 或者: from grpc.beta.implementations import server [as 别名]
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,))