def test_server_lifecycle(self): for _ in range(100): server = implementations.server( self._method_implementations, options=self._server_options) port = server.add_secure_port('[::]:0', self._server_credentials) server.start() server.stop(test_constants.SHORT_TIMEOUT).wait() for _ in range(100): server = implementations.server( self._method_implementations, options=self._server_options) server.add_secure_port('[::]:0', self._server_credentials) server.add_insecure_port('[::]:0') with server: server.stop(test_constants.SHORT_TIMEOUT) server.stop(test_constants.SHORT_TIMEOUT)
def beta_create_BigtableService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_service_messages_pb2 import gcloud.bigtable._generated.bigtable_data_pb2 request_deserializers = { ('google.bigtable.v1.BigtableService', 'CheckAndMutateRow'): gcloud.bigtable._generated.bigtable_service_messages_pb2.CheckAndMutateRowRequest.FromString, ('google.bigtable.v1.BigtableService', 'MutateRow'): gcloud.bigtable._generated.bigtable_service_messages_pb2.MutateRowRequest.FromString, ('google.bigtable.v1.BigtableService', 'ReadModifyWriteRow'): gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadModifyWriteRowRequest.FromString, ('google.bigtable.v1.BigtableService', 'ReadRows'): gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadRowsRequest.FromString, ('google.bigtable.v1.BigtableService', 'SampleRowKeys'): gcloud.bigtable._generated.bigtable_service_messages_pb2.SampleRowKeysRequest.FromString, } response_serializers = { ('google.bigtable.v1.BigtableService', 'CheckAndMutateRow'): gcloud.bigtable._generated.bigtable_service_messages_pb2.CheckAndMutateRowResponse.SerializeToString, ('google.bigtable.v1.BigtableService', 'MutateRow'): google.protobuf.empty_pb2.Empty.SerializeToString, ('google.bigtable.v1.BigtableService', 'ReadModifyWriteRow'): gcloud.bigtable._generated.bigtable_data_pb2.Row.SerializeToString, ('google.bigtable.v1.BigtableService', 'ReadRows'): gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadRowsResponse.SerializeToString, ('google.bigtable.v1.BigtableService', 'SampleRowKeys'): gcloud.bigtable._generated.bigtable_service_messages_pb2.SampleRowKeysResponse.SerializeToString, } method_implementations = { ('google.bigtable.v1.BigtableService', 'CheckAndMutateRow'): face_utilities.unary_unary_inline(servicer.CheckAndMutateRow), ('google.bigtable.v1.BigtableService', 'MutateRow'): face_utilities.unary_unary_inline(servicer.MutateRow), ('google.bigtable.v1.BigtableService', 'ReadModifyWriteRow'): face_utilities.unary_unary_inline(servicer.ReadModifyWriteRow), ('google.bigtable.v1.BigtableService', 'ReadRows'): face_utilities.unary_stream_inline(servicer.ReadRows), ('google.bigtable.v1.BigtableService', 'SampleRowKeys'): face_utilities.unary_stream_inline(servicer.SampleRowKeys), } 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)
def _create_server(self, config): if config.server_type == control_pb2.SYNC_SERVER: servicer = benchmark_server.BenchmarkServer() server = services_pb2.beta_create_BenchmarkService_server(servicer) elif config.server_type == control_pb2.ASYNC_GENERIC_SERVER: resp_size = config.payload_config.bytebuf_params.resp_size servicer = benchmark_server.GenericBenchmarkServer(resp_size) method_implementations = { ('grpc.testing.BenchmarkService', 'StreamingCall'): utilities.stream_stream_inline(servicer.StreamingCall), ('grpc.testing.BenchmarkService', 'UnaryCall'): utilities.unary_unary_inline(servicer.UnaryCall), } server = implementations.server(method_implementations) else: raise Exception('Unsupported server type {}'.format(config.server_type)) if config.HasField('security_params'): # Use SSL server_creds = implementations.ssl_server_credentials([( resources.private_key(), resources.certificate_chain())]) port = server.add_secure_port('[::]:{}'.format(config.port), server_creds) else: port = server.add_insecure_port('[::]:{}'.format(config.port)) return (server, port)
def beta_create_BfKvService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('bfkv.BfKvService', 'GetKv'): bfgateway__pb2.BfKvData.FromString, ('bfkv.BfKvService', 'Ping'): bfgateway__pb2.BfPingData.FromString, ('bfkv.BfKvService', 'PingStreamC'): google_dot_protobuf_dot_any__pb2.Any.FromString, ('bfkv.BfKvService', 'PingStreamCS'): google_dot_protobuf_dot_any__pb2.Any.FromString, ('bfkv.BfKvService', 'PingStreamS'): google_dot_protobuf_dot_any__pb2.Any.FromString, ('bfkv.BfKvService', 'SetKv'): bfgateway__pb2.BfKvData.FromString, } response_serializers = { ('bfkv.BfKvService', 'GetKv'): bfgateway__pb2.BfKvData.SerializeToString, ('bfkv.BfKvService', 'Ping'): bfgateway__pb2.BfPingData.SerializeToString, ('bfkv.BfKvService', 'PingStreamC'): google_dot_protobuf_dot_any__pb2.Any.SerializeToString, ('bfkv.BfKvService', 'PingStreamCS'): google_dot_protobuf_dot_any__pb2.Any.SerializeToString, ('bfkv.BfKvService', 'PingStreamS'): google_dot_protobuf_dot_any__pb2.Any.SerializeToString, ('bfkv.BfKvService', 'SetKv'): bfgateway__pb2.BfVoid.SerializeToString, } method_implementations = { ('bfkv.BfKvService', 'GetKv'): face_utilities.unary_unary_inline(servicer.GetKv), ('bfkv.BfKvService', 'Ping'): face_utilities.unary_unary_inline(servicer.Ping), ('bfkv.BfKvService', 'PingStreamC'): face_utilities.stream_unary_inline(servicer.PingStreamC), ('bfkv.BfKvService', 'PingStreamCS'): face_utilities.stream_stream_inline(servicer.PingStreamCS), ('bfkv.BfKvService', 'PingStreamS'): face_utilities.unary_stream_inline(servicer.PingStreamS), ('bfkv.BfKvService', 'SetKv'): face_utilities.unary_unary_inline(servicer.SetKv), } 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)
def beta_create_FirestoreAdmin_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 = { ('google.firestore.admin.v1beta1.FirestoreAdmin', 'CreateIndex'): CreateIndexRequest.FromString, ('google.firestore.admin.v1beta1.FirestoreAdmin', 'DeleteIndex'): DeleteIndexRequest.FromString, ('google.firestore.admin.v1beta1.FirestoreAdmin', 'GetIndex'): GetIndexRequest.FromString, ('google.firestore.admin.v1beta1.FirestoreAdmin', 'ListIndexes'): ListIndexesRequest.FromString, } response_serializers = { ('google.firestore.admin.v1beta1.FirestoreAdmin', 'CreateIndex'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ('google.firestore.admin.v1beta1.FirestoreAdmin', 'DeleteIndex'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ('google.firestore.admin.v1beta1.FirestoreAdmin', 'GetIndex'): google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_admin_dot_index__pb2.Index.SerializeToString, ('google.firestore.admin.v1beta1.FirestoreAdmin', 'ListIndexes'): ListIndexesResponse.SerializeToString, } method_implementations = { ('google.firestore.admin.v1beta1.FirestoreAdmin', 'CreateIndex'): face_utilities.unary_unary_inline(servicer.CreateIndex), ('google.firestore.admin.v1beta1.FirestoreAdmin', 'DeleteIndex'): face_utilities.unary_unary_inline(servicer.DeleteIndex), ('google.firestore.admin.v1beta1.FirestoreAdmin', 'GetIndex'): face_utilities.unary_unary_inline(servicer.GetIndex), ('google.firestore.admin.v1beta1.FirestoreAdmin', 'ListIndexes'): face_utilities.unary_unary_inline(servicer.ListIndexes), } 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)
def beta_create_Vitess_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('vtgateservice.Vitess', 'Begin'): vtgate__pb2.BeginRequest.FromString, ('vtgateservice.Vitess', 'Commit'): vtgate__pb2.CommitRequest.FromString, ('vtgateservice.Vitess', 'Execute'): vtgate__pb2.ExecuteRequest.FromString, ('vtgateservice.Vitess', 'ExecuteBatchKeyspaceIds'): vtgate__pb2.ExecuteBatchKeyspaceIdsRequest.FromString, ('vtgateservice.Vitess', 'ExecuteBatchShards'): vtgate__pb2.ExecuteBatchShardsRequest.FromString, ('vtgateservice.Vitess', 'ExecuteEntityIds'): vtgate__pb2.ExecuteEntityIdsRequest.FromString, ('vtgateservice.Vitess', 'ExecuteKeyRanges'): vtgate__pb2.ExecuteKeyRangesRequest.FromString, ('vtgateservice.Vitess', 'ExecuteKeyspaceIds'): vtgate__pb2.ExecuteKeyspaceIdsRequest.FromString, ('vtgateservice.Vitess', 'ExecuteShards'): vtgate__pb2.ExecuteShardsRequest.FromString, ('vtgateservice.Vitess', 'GetSrvKeyspace'): vtgate__pb2.GetSrvKeyspaceRequest.FromString, ('vtgateservice.Vitess', 'Rollback'): vtgate__pb2.RollbackRequest.FromString, ('vtgateservice.Vitess', 'SplitQuery'): vtgate__pb2.SplitQueryRequest.FromString, ('vtgateservice.Vitess', 'StreamExecute'): vtgate__pb2.StreamExecuteRequest.FromString, ('vtgateservice.Vitess', 'StreamExecuteKeyRanges'): vtgate__pb2.StreamExecuteKeyRangesRequest.FromString, ('vtgateservice.Vitess', 'StreamExecuteKeyspaceIds'): vtgate__pb2.StreamExecuteKeyspaceIdsRequest.FromString, ('vtgateservice.Vitess', 'StreamExecuteShards'): vtgate__pb2.StreamExecuteShardsRequest.FromString, ('vtgateservice.Vitess', 'UpdateStream'): vtgate__pb2.UpdateStreamRequest.FromString, } response_serializers = { ('vtgateservice.Vitess', 'Begin'): vtgate__pb2.BeginResponse.SerializeToString, ('vtgateservice.Vitess', 'Commit'): vtgate__pb2.CommitResponse.SerializeToString, ('vtgateservice.Vitess', 'Execute'): vtgate__pb2.ExecuteResponse.SerializeToString, ('vtgateservice.Vitess', 'ExecuteBatchKeyspaceIds'): vtgate__pb2.ExecuteBatchKeyspaceIdsResponse.SerializeToString, ('vtgateservice.Vitess', 'ExecuteBatchShards'): vtgate__pb2.ExecuteBatchShardsResponse.SerializeToString, ('vtgateservice.Vitess', 'ExecuteEntityIds'): vtgate__pb2.ExecuteEntityIdsResponse.SerializeToString, ('vtgateservice.Vitess', 'ExecuteKeyRanges'): vtgate__pb2.ExecuteKeyRangesResponse.SerializeToString, ('vtgateservice.Vitess', 'ExecuteKeyspaceIds'): vtgate__pb2.ExecuteKeyspaceIdsResponse.SerializeToString, ('vtgateservice.Vitess', 'ExecuteShards'): vtgate__pb2.ExecuteShardsResponse.SerializeToString, ('vtgateservice.Vitess', 'GetSrvKeyspace'): vtgate__pb2.GetSrvKeyspaceResponse.SerializeToString, ('vtgateservice.Vitess', 'Rollback'): vtgate__pb2.RollbackResponse.SerializeToString, ('vtgateservice.Vitess', 'SplitQuery'): vtgate__pb2.SplitQueryResponse.SerializeToString, ('vtgateservice.Vitess', 'StreamExecute'): vtgate__pb2.StreamExecuteResponse.SerializeToString, ('vtgateservice.Vitess', 'StreamExecuteKeyRanges'): vtgate__pb2.StreamExecuteKeyRangesResponse.SerializeToString, ('vtgateservice.Vitess', 'StreamExecuteKeyspaceIds'): vtgate__pb2.StreamExecuteKeyspaceIdsResponse.SerializeToString, ('vtgateservice.Vitess', 'StreamExecuteShards'): vtgate__pb2.StreamExecuteShardsResponse.SerializeToString, ('vtgateservice.Vitess', 'UpdateStream'): vtgate__pb2.UpdateStreamResponse.SerializeToString, } method_implementations = { ('vtgateservice.Vitess', 'Begin'): face_utilities.unary_unary_inline(servicer.Begin), ('vtgateservice.Vitess', 'Commit'): face_utilities.unary_unary_inline(servicer.Commit), ('vtgateservice.Vitess', 'Execute'): face_utilities.unary_unary_inline(servicer.Execute), ('vtgateservice.Vitess', 'ExecuteBatchKeyspaceIds'): face_utilities.unary_unary_inline(servicer.ExecuteBatchKeyspaceIds), ('vtgateservice.Vitess', 'ExecuteBatchShards'): face_utilities.unary_unary_inline(servicer.ExecuteBatchShards), ('vtgateservice.Vitess', 'ExecuteEntityIds'): face_utilities.unary_unary_inline(servicer.ExecuteEntityIds), ('vtgateservice.Vitess', 'ExecuteKeyRanges'): face_utilities.unary_unary_inline(servicer.ExecuteKeyRanges), ('vtgateservice.Vitess', 'ExecuteKeyspaceIds'): face_utilities.unary_unary_inline(servicer.ExecuteKeyspaceIds), ('vtgateservice.Vitess', 'ExecuteShards'): face_utilities.unary_unary_inline(servicer.ExecuteShards), ('vtgateservice.Vitess', 'GetSrvKeyspace'): face_utilities.unary_unary_inline(servicer.GetSrvKeyspace), ('vtgateservice.Vitess', 'Rollback'): face_utilities.unary_unary_inline(servicer.Rollback), ('vtgateservice.Vitess', 'SplitQuery'): face_utilities.unary_unary_inline(servicer.SplitQuery), ('vtgateservice.Vitess', 'StreamExecute'): face_utilities.unary_stream_inline(servicer.StreamExecute), ('vtgateservice.Vitess', 'StreamExecuteKeyRanges'): face_utilities.unary_stream_inline(servicer.StreamExecuteKeyRanges), ('vtgateservice.Vitess', 'StreamExecuteKeyspaceIds'): face_utilities.unary_stream_inline(servicer.StreamExecuteKeyspaceIds), ('vtgateservice.Vitess', 'StreamExecuteShards'): face_utilities.unary_stream_inline(servicer.StreamExecuteShards), ('vtgateservice.Vitess', 'UpdateStream'): face_utilities.unary_stream_inline(servicer.UpdateStream), } 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)
def beta_create_BigtableTableAdmin_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('google.bigtable.admin.v2.BigtableTableAdmin', 'CreateTable'): CreateTableRequest.FromString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'DeleteTable'): DeleteTableRequest.FromString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'DropRowRange'): DropRowRangeRequest.FromString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'GetTable'): GetTableRequest.FromString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'ListTables'): ListTablesRequest.FromString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'ModifyColumnFamilies'): ModifyColumnFamiliesRequest.FromString, } response_serializers = { ('google.bigtable.admin.v2.BigtableTableAdmin', 'CreateTable'): google_dot_bigtable_dot_admin_dot_v2_dot_table__pb2.Table.SerializeToString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'DeleteTable'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'DropRowRange'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'GetTable'): google_dot_bigtable_dot_admin_dot_v2_dot_table__pb2.Table.SerializeToString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'ListTables'): ListTablesResponse.SerializeToString, ('google.bigtable.admin.v2.BigtableTableAdmin', 'ModifyColumnFamilies'): google_dot_bigtable_dot_admin_dot_v2_dot_table__pb2.Table.SerializeToString, } method_implementations = { ('google.bigtable.admin.v2.BigtableTableAdmin', 'CreateTable'): face_utilities.unary_unary_inline(servicer.CreateTable), ('google.bigtable.admin.v2.BigtableTableAdmin', 'DeleteTable'): face_utilities.unary_unary_inline(servicer.DeleteTable), ('google.bigtable.admin.v2.BigtableTableAdmin', 'DropRowRange'): face_utilities.unary_unary_inline(servicer.DropRowRange), ('google.bigtable.admin.v2.BigtableTableAdmin', 'GetTable'): face_utilities.unary_unary_inline(servicer.GetTable), ('google.bigtable.admin.v2.BigtableTableAdmin', 'ListTables'): face_utilities.unary_unary_inline(servicer.ListTables), ('google.bigtable.admin.v2.BigtableTableAdmin', 'ModifyColumnFamilies'): face_utilities.unary_unary_inline(servicer.ModifyColumnFamilies), } 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)
def beta_create_SequenceAnnotationService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import ga4gh.sequence_annotation_service_pb2 import ga4gh.sequence_annotation_service_pb2 import ga4gh.sequence_annotation_service_pb2 import ga4gh.sequence_annotations_pb2 import ga4gh.sequence_annotation_service_pb2 import ga4gh.sequence_annotation_service_pb2 import ga4gh.sequence_annotation_service_pb2 import ga4gh.sequence_annotations_pb2 request_deserializers = { ('ga4gh.SequenceAnnotationService', 'GetFeature'): ga4gh.sequence_annotation_service_pb2.GetFeatureRequest.FromString, ('ga4gh.SequenceAnnotationService', 'GetFeatureSet'): ga4gh.sequence_annotation_service_pb2.GetFeatureSetRequest.FromString, ('ga4gh.SequenceAnnotationService', 'SearchFeatureSets'): ga4gh.sequence_annotation_service_pb2.SearchFeatureSetsRequest.FromString, ('ga4gh.SequenceAnnotationService', 'SearchFeatures'): ga4gh.sequence_annotation_service_pb2.SearchFeaturesRequest.FromString, } response_serializers = { ('ga4gh.SequenceAnnotationService', 'GetFeature'): ga4gh.sequence_annotations_pb2.Feature.SerializeToString, ('ga4gh.SequenceAnnotationService', 'GetFeatureSet'): ga4gh.sequence_annotations_pb2.FeatureSet.SerializeToString, ('ga4gh.SequenceAnnotationService', 'SearchFeatureSets'): ga4gh.sequence_annotation_service_pb2.SearchFeatureSetsResponse.SerializeToString, ('ga4gh.SequenceAnnotationService', 'SearchFeatures'): ga4gh.sequence_annotation_service_pb2.SearchFeaturesResponse.SerializeToString, } method_implementations = { ('ga4gh.SequenceAnnotationService', 'GetFeature'): face_utilities.unary_unary_inline(servicer.GetFeature), ('ga4gh.SequenceAnnotationService', 'GetFeatureSet'): face_utilities.unary_unary_inline(servicer.GetFeatureSet), ('ga4gh.SequenceAnnotationService', 'SearchFeatureSets'): face_utilities.unary_unary_inline(servicer.SearchFeatureSets), ('ga4gh.SequenceAnnotationService', 'SearchFeatures'): face_utilities.unary_unary_inline(servicer.SearchFeatures), } 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)
def beta_create_Store_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 = { ('store.Store', 'AddItem'): AddItemRequest.FromString, ('store.Store', 'AddItems'): AddItemRequest.FromString, ('store.Store', 'ListInventory'): Empty.FromString, ('store.Store', 'QueryQuantities'): QueryItemRequest.FromString, ('store.Store', 'QueryQuantity'): QueryItemRequest.FromString, ('store.Store', 'RemoveItem'): RemoveItemRequest.FromString, ('store.Store', 'RemoveItems'): RemoveItemRequest.FromString, } response_serializers = { ('store.Store', 'AddItem'): Empty.SerializeToString, ('store.Store', 'AddItems'): Empty.SerializeToString, ('store.Store', 'ListInventory'): QuantityResponse.SerializeToString, ('store.Store', 'QueryQuantities'): QuantityResponse.SerializeToString, ('store.Store', 'QueryQuantity'): QuantityResponse.SerializeToString, ('store.Store', 'RemoveItem'): RemoveItemResponse.SerializeToString, ('store.Store', 'RemoveItems'): RemoveItemResponse.SerializeToString, } method_implementations = { ('store.Store', 'AddItem'): face_utilities.unary_unary_inline(servicer.AddItem), ('store.Store', 'AddItems'): face_utilities.stream_unary_inline(servicer.AddItems), ('store.Store', 'ListInventory'): face_utilities.unary_stream_inline(servicer.ListInventory), ('store.Store', 'QueryQuantities'): face_utilities.stream_stream_inline(servicer.QueryQuantities), ('store.Store', 'QueryQuantity'): face_utilities.unary_unary_inline(servicer.QueryQuantity), ('store.Store', 'RemoveItem'): face_utilities.unary_unary_inline(servicer.RemoveItem), ('store.Store', 'RemoveItems'): face_utilities.stream_unary_inline(servicer.RemoveItems), } 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)
def beta_create_MysqlCtl_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 request_deserializers = { ('mysqlctl.MysqlCtl', 'ReinitConfig'): mysqlctl_pb2.ReinitConfigRequest.FromString, ('mysqlctl.MysqlCtl', 'RunMysqlUpgrade'): mysqlctl_pb2.RunMysqlUpgradeRequest.FromString, ('mysqlctl.MysqlCtl', 'Shutdown'): mysqlctl_pb2.ShutdownRequest.FromString, ('mysqlctl.MysqlCtl', 'Start'): mysqlctl_pb2.StartRequest.FromString, } response_serializers = { ('mysqlctl.MysqlCtl', 'ReinitConfig'): mysqlctl_pb2.ReinitConfigResponse.SerializeToString, ('mysqlctl.MysqlCtl', 'RunMysqlUpgrade'): mysqlctl_pb2.RunMysqlUpgradeResponse.SerializeToString, ('mysqlctl.MysqlCtl', 'Shutdown'): mysqlctl_pb2.ShutdownResponse.SerializeToString, ('mysqlctl.MysqlCtl', 'Start'): mysqlctl_pb2.StartResponse.SerializeToString, } method_implementations = { ('mysqlctl.MysqlCtl', 'ReinitConfig'): face_utilities.unary_unary_inline(servicer.ReinitConfig), ('mysqlctl.MysqlCtl', 'RunMysqlUpgrade'): face_utilities.unary_unary_inline(servicer.RunMysqlUpgrade), ('mysqlctl.MysqlCtl', 'Shutdown'): face_utilities.unary_unary_inline(servicer.Shutdown), ('mysqlctl.MysqlCtl', 'Start'): face_utilities.unary_unary_inline(servicer.Start), } 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)
def test_stub_context(self): server = implementations.server( self._method_implementations, options=self._server_options) port = server.add_secure_port('[::]:0', self._server_credentials) server.start() channel = test_utilities.not_really_secure_channel( 'localhost', port, self._channel_credentials, _SERVER_HOST_OVERRIDE) dynamic_stub = implementations.dynamic_stub( channel, _GROUP, self._cardinalities, options=self._stub_options) for _ in range(100): with dynamic_stub: pass for _ in range(10): with dynamic_stub: call_options = interfaces.grpc_call_options( disable_compression=True) response = getattr(dynamic_stub, _UNARY_UNARY)( _REQUEST, test_constants.LONG_TIMEOUT, protocol_options=call_options) self.assertEqual(_RESPONSE, response) self.assertIsNotNone(self._servicer.peer()) server.stop(test_constants.SHORT_TIMEOUT).wait()
def beta_create_BfDatafeedService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 request_deserializers = { ('bftrader.bfdatafeed.BfDatafeedService', 'GetBar'): bftrader_pb2.BfGetBarReq.FromString, ('bftrader.bfdatafeed.BfDatafeedService', 'GetTickPack'): bftrader_pb2.BfGetTickPackReq.FromString, ('bftrader.bfdatafeed.BfDatafeedService', 'InsertBar'): bftrader_pb2.BfBarData.FromString, ('bftrader.bfdatafeed.BfDatafeedService', 'InsertTickPack'): bftrader_pb2.BfTickPackData.FromString, } response_serializers = { ('bftrader.bfdatafeed.BfDatafeedService', 'GetBar'): bftrader_pb2.BfBarData.SerializeToString, ('bftrader.bfdatafeed.BfDatafeedService', 'GetTickPack'): bftrader_pb2.BfTickPackData.SerializeToString, ('bftrader.bfdatafeed.BfDatafeedService', 'InsertBar'): bftrader_pb2.BfVoid.SerializeToString, ('bftrader.bfdatafeed.BfDatafeedService', 'InsertTickPack'): bftrader_pb2.BfVoid.SerializeToString, } method_implementations = { ('bftrader.bfdatafeed.BfDatafeedService', 'GetBar'): face_utilities.unary_stream_inline(servicer.GetBar), ('bftrader.bfdatafeed.BfDatafeedService', 'GetTickPack'): face_utilities.unary_stream_inline(servicer.GetTickPack), ('bftrader.bfdatafeed.BfDatafeedService', 'InsertBar'): face_utilities.unary_unary_inline(servicer.InsertBar), ('bftrader.bfdatafeed.BfDatafeedService', 'InsertTickPack'): face_utilities.unary_unary_inline(servicer.InsertTickPack), } 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)
def beta_create_UberAPIService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import uber_pb2 import uber_pb2 import uber_pb2 import uber_pb2 import uber_pb2 import uber_pb2 import google.protobuf.empty_pb2 import uber_pb2 import uber_pb2 import uber_pb2 request_deserializers = { ('uberapi.UberAPIService', 'GetEstimatesPrice'): uber_pb2.GetEstimatesPriceRequest.FromString, ('uberapi.UberAPIService', 'GetEstimatesTime'): uber_pb2.GetEstimatesTimeRequest.FromString, ('uberapi.UberAPIService', 'GetHistory'): uber_pb2.GetHistoryRequest.FromString, ('uberapi.UberAPIService', 'GetMe'): google.protobuf.empty_pb2.Empty.FromString, ('uberapi.UberAPIService', 'GetProducts'): uber_pb2.GetProductsRequest.FromString, } response_serializers = { ('uberapi.UberAPIService', 'GetEstimatesPrice'): uber_pb2.GetEstimatesPriceResponse.SerializeToString, ('uberapi.UberAPIService', 'GetEstimatesTime'): uber_pb2.GetEstimatesTimeResponse.SerializeToString, ('uberapi.UberAPIService', 'GetHistory'): uber_pb2.Activities.SerializeToString, ('uberapi.UberAPIService', 'GetMe'): uber_pb2.Profile.SerializeToString, ('uberapi.UberAPIService', 'GetProducts'): uber_pb2.GetProductsResponse.SerializeToString, } method_implementations = { ('uberapi.UberAPIService', 'GetEstimatesPrice'): face_utilities.unary_unary_inline(servicer.GetEstimatesPrice), ('uberapi.UberAPIService', 'GetEstimatesTime'): face_utilities.unary_unary_inline(servicer.GetEstimatesTime), ('uberapi.UberAPIService', 'GetHistory'): face_utilities.unary_unary_inline(servicer.GetHistory), ('uberapi.UberAPIService', 'GetMe'): face_utilities.unary_unary_inline(servicer.GetMe), ('uberapi.UberAPIService', 'GetProducts'): face_utilities.unary_unary_inline(servicer.GetProducts), } 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)
def beta_create_UsersService_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 = { ('soboto.users.UsersService', 'getBOUserInfo'): GetBOUserInfoRequest.FromString, ('soboto.users.UsersService', 'getCustomerInfo'): GetCustomerInfoRequest.FromString, ('soboto.users.UsersService', 'getUserPermissions'): GetUserPermissionsRequest.FromString, ('soboto.users.UsersService', 'setEntityOwner'): SetEntityOwnerRequest.FromString, ('soboto.users.UsersService', 'validateAuthenticationToken'): ValidateAuthenticationTokenRequest.FromString, } response_serializers = { ('soboto.users.UsersService', 'getBOUserInfo'): GetBOUserInfoResponse.SerializeToString, ('soboto.users.UsersService', 'getCustomerInfo'): GetCustomerInfoResponse.SerializeToString, ('soboto.users.UsersService', 'getUserPermissions'): GetUserPermissionsResponse.SerializeToString, ('soboto.users.UsersService', 'setEntityOwner'): SetEntityOwnerResponse.SerializeToString, ('soboto.users.UsersService', 'validateAuthenticationToken'): ValidateAuthenticationTokenResponse.SerializeToString, } method_implementations = { ('soboto.users.UsersService', 'getBOUserInfo'): face_utilities.unary_unary_inline(servicer.getBOUserInfo), ('soboto.users.UsersService', 'getCustomerInfo'): face_utilities.unary_unary_inline(servicer.getCustomerInfo), ('soboto.users.UsersService', 'getUserPermissions'): face_utilities.unary_unary_inline(servicer.getUserPermissions), ('soboto.users.UsersService', 'setEntityOwner'): face_utilities.unary_unary_inline(servicer.setEntityOwner), ('soboto.users.UsersService', 'validateAuthenticationToken'): face_utilities.unary_unary_inline(servicer.validateAuthenticationToken), } 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)
def beta_create_ReadService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import ga4gh.read_service_pb2 import ga4gh.read_service_pb2 import ga4gh.read_service_pb2 import ga4gh.reads_pb2 import ga4gh.read_service_pb2 import ga4gh.read_service_pb2 request_deserializers = { ("ga4gh.ReadService", "GetReadGroupSet"): ga4gh.read_service_pb2.GetReadGroupSetRequest.FromString, ("ga4gh.ReadService", "SearchReadGroupSets"): ga4gh.read_service_pb2.SearchReadGroupSetsRequest.FromString, ("ga4gh.ReadService", "SearchReads"): ga4gh.read_service_pb2.SearchReadsRequest.FromString, } response_serializers = { ("ga4gh.ReadService", "GetReadGroupSet"): ga4gh.reads_pb2.ReadGroupSet.SerializeToString, ( "ga4gh.ReadService", "SearchReadGroupSets", ): ga4gh.read_service_pb2.SearchReadGroupSetsResponse.SerializeToString, ("ga4gh.ReadService", "SearchReads"): ga4gh.read_service_pb2.SearchReadsResponse.SerializeToString, } method_implementations = { ("ga4gh.ReadService", "GetReadGroupSet"): face_utilities.unary_unary_inline(servicer.GetReadGroupSet), ("ga4gh.ReadService", "SearchReadGroupSets"): face_utilities.unary_unary_inline(servicer.SearchReadGroupSets), ("ga4gh.ReadService", "SearchReads"): face_utilities.unary_unary_inline(servicer.SearchReads), } 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)
def beta_create_ScootDaemon_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 = { ('protocol.ScootDaemon', 'CheckoutSnapshot'): CheckoutSnapshotRequest.FromString, ('protocol.ScootDaemon', 'CreateSnapshot'): CreateSnapshotRequest.FromString, ('protocol.ScootDaemon', 'Echo'): EchoRequest.FromString, ('protocol.ScootDaemon', 'Poll'): PollRequest.FromString, ('protocol.ScootDaemon', 'Run'): RunRequest.FromString, ('protocol.ScootDaemon', 'StopDaemon'): EmptyStruct.FromString, } response_serializers = { ('protocol.ScootDaemon', 'CheckoutSnapshot'): CheckoutSnapshotReply.SerializeToString, ('protocol.ScootDaemon', 'CreateSnapshot'): CreateSnapshotReply.SerializeToString, ('protocol.ScootDaemon', 'Echo'): EchoReply.SerializeToString, ('protocol.ScootDaemon', 'Poll'): PollReply.SerializeToString, ('protocol.ScootDaemon', 'Run'): RunReply.SerializeToString, ('protocol.ScootDaemon', 'StopDaemon'): EmptyStruct.SerializeToString, } method_implementations = { ('protocol.ScootDaemon', 'CheckoutSnapshot'): face_utilities.unary_unary_inline(servicer.CheckoutSnapshot), ('protocol.ScootDaemon', 'CreateSnapshot'): face_utilities.unary_unary_inline(servicer.CreateSnapshot), ('protocol.ScootDaemon', 'Echo'): face_utilities.unary_unary_inline(servicer.Echo), ('protocol.ScootDaemon', 'Poll'): face_utilities.unary_unary_inline(servicer.Poll), ('protocol.ScootDaemon', 'Run'): face_utilities.unary_unary_inline(servicer.Run), ('protocol.ScootDaemon', 'StopDaemon'): face_utilities.unary_unary_inline(servicer.StopDaemon), } 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)
def beta_create_MetricsServiceV2_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 = { ('google.logging.v2.MetricsServiceV2', 'CreateLogMetric'): CreateLogMetricRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'DeleteLogMetric'): DeleteLogMetricRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'GetLogMetric'): GetLogMetricRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'ListLogMetrics'): ListLogMetricsRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'UpdateLogMetric'): UpdateLogMetricRequest.FromString, } response_serializers = { ('google.logging.v2.MetricsServiceV2', 'CreateLogMetric'): LogMetric.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'DeleteLogMetric'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'GetLogMetric'): LogMetric.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'ListLogMetrics'): ListLogMetricsResponse.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'UpdateLogMetric'): LogMetric.SerializeToString, } method_implementations = { ('google.logging.v2.MetricsServiceV2', 'CreateLogMetric'): face_utilities.unary_unary_inline(servicer.CreateLogMetric), ('google.logging.v2.MetricsServiceV2', 'DeleteLogMetric'): face_utilities.unary_unary_inline(servicer.DeleteLogMetric), ('google.logging.v2.MetricsServiceV2', 'GetLogMetric'): face_utilities.unary_unary_inline(servicer.GetLogMetric), ('google.logging.v2.MetricsServiceV2', 'ListLogMetrics'): face_utilities.unary_unary_inline(servicer.ListLogMetrics), ('google.logging.v2.MetricsServiceV2', 'UpdateLogMetric'): face_utilities.unary_unary_inline(servicer.UpdateLogMetric), } 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)
def beta_create_Admin_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 = { ('protos.Admin', 'GetModuleLogLevel'): LogLevelRequest.FromString, ('protos.Admin', 'GetStatus'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, ('protos.Admin', 'SetModuleLogLevel'): LogLevelRequest.FromString, ('protos.Admin', 'StartServer'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, ('protos.Admin', 'StopServer'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, } response_serializers = { ('protos.Admin', 'GetModuleLogLevel'): LogLevelResponse.SerializeToString, ('protos.Admin', 'GetStatus'): ServerStatus.SerializeToString, ('protos.Admin', 'SetModuleLogLevel'): LogLevelResponse.SerializeToString, ('protos.Admin', 'StartServer'): ServerStatus.SerializeToString, ('protos.Admin', 'StopServer'): ServerStatus.SerializeToString, } method_implementations = { ('protos.Admin', 'GetModuleLogLevel'): face_utilities.unary_unary_inline(servicer.GetModuleLogLevel), ('protos.Admin', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus), ('protos.Admin', 'SetModuleLogLevel'): face_utilities.unary_unary_inline(servicer.SetModuleLogLevel), ('protos.Admin', 'StartServer'): face_utilities.unary_unary_inline(servicer.StartServer), ('protos.Admin', 'StopServer'): face_utilities.unary_unary_inline(servicer.StopServer), } 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)
def test_immediately_connectable_channel_connectivity(self): server = implementations.server({}) port = server.add_insecure_port('[::]:0') server.start() channel = implementations.insecure_channel('localhost', port) callback = _Callback() try: ready_future = utilities.channel_ready_future(channel) ready_future.add_done_callback(callback.accept_value) self.assertIsNone( ready_future.result(timeout=test_constants.LONG_TIMEOUT)) value_passed_to_callback = callback.block_until_called() self.assertIs(ready_future, value_passed_to_callback) self.assertFalse(ready_future.cancelled()) self.assertTrue(ready_future.done()) self.assertFalse(ready_future.running()) # Cancellation after maturity has no effect. ready_future.cancel() self.assertFalse(ready_future.cancelled()) self.assertTrue(ready_future.done()) self.assertFalse(ready_future.running()) finally: ready_future.cancel() server.stop(0)
def beta_create_FrameSpaceService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_service_pb2 import proto.framespace.framespace_pb2 request_deserializers = { ('framespace.FrameSpaceService', 'SearchAxes'): proto.framespace.framespace_service_pb2.SearchAxesRequest.FromString, ('framespace.FrameSpaceService', 'SearchDataFrames'): proto.framespace.framespace_service_pb2.SearchDataFramesRequest.FromString, ('framespace.FrameSpaceService', 'SearchKeySpaces'): proto.framespace.framespace_service_pb2.SearchKeySpacesRequest.FromString, ('framespace.FrameSpaceService', 'SearchUnits'): proto.framespace.framespace_service_pb2.SearchUnitsRequest.FromString, ('framespace.FrameSpaceService', 'SliceDataFrame'): proto.framespace.framespace_service_pb2.SliceDataFrameRequest.FromString, } response_serializers = { ('framespace.FrameSpaceService', 'SearchAxes'): proto.framespace.framespace_service_pb2.SearchAxesResponse.SerializeToString, ('framespace.FrameSpaceService', 'SearchDataFrames'): proto.framespace.framespace_service_pb2.SearchDataFramesResponse.SerializeToString, ('framespace.FrameSpaceService', 'SearchKeySpaces'): proto.framespace.framespace_service_pb2.SearchKeySpacesResponse.SerializeToString, ('framespace.FrameSpaceService', 'SearchUnits'): proto.framespace.framespace_service_pb2.SearchUnitsResponse.SerializeToString, ('framespace.FrameSpaceService', 'SliceDataFrame'): proto.framespace.framespace_pb2.DataFrame.SerializeToString, } method_implementations = { ('framespace.FrameSpaceService', 'SearchAxes'): face_utilities.unary_unary_inline(servicer.SearchAxes), ('framespace.FrameSpaceService', 'SearchDataFrames'): face_utilities.unary_unary_inline(servicer.SearchDataFrames), ('framespace.FrameSpaceService', 'SearchKeySpaces'): face_utilities.unary_unary_inline(servicer.SearchKeySpaces), ('framespace.FrameSpaceService', 'SearchUnits'): face_utilities.unary_unary_inline(servicer.SearchUnits), ('framespace.FrameSpaceService', 'SliceDataFrame'): face_utilities.unary_unary_inline(servicer.SliceDataFrame), } 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)
def beta_create_BioMetadataService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import ga4gh.bio_metadata_service_pb2 import ga4gh.bio_metadata_service_pb2 import ga4gh.bio_metadata_service_pb2 import ga4gh.bio_metadata_service_pb2 import ga4gh.bio_metadata_service_pb2 import ga4gh.bio_metadata_pb2 import ga4gh.bio_metadata_service_pb2 import ga4gh.bio_metadata_pb2 request_deserializers = { ('ga4gh.BioMetadataService', 'GetBioSample'): ga4gh.bio_metadata_service_pb2.GetBioSampleRequest.FromString, ('ga4gh.BioMetadataService', 'GetIndividual'): ga4gh.bio_metadata_service_pb2.GetIndividualRequest.FromString, ('ga4gh.BioMetadataService', 'SearchBioSamples'): ga4gh.bio_metadata_service_pb2.SearchBioSamplesRequest.FromString, ('ga4gh.BioMetadataService', 'SearchIndividuals'): ga4gh.bio_metadata_service_pb2.SearchIndividualsRequest.FromString, } response_serializers = { ('ga4gh.BioMetadataService', 'GetBioSample'): ga4gh.bio_metadata_pb2.BioSample.SerializeToString, ('ga4gh.BioMetadataService', 'GetIndividual'): ga4gh.bio_metadata_pb2.Individual.SerializeToString, ('ga4gh.BioMetadataService', 'SearchBioSamples'): ga4gh.bio_metadata_service_pb2.SearchBioSamplesResponse.SerializeToString, ('ga4gh.BioMetadataService', 'SearchIndividuals'): ga4gh.bio_metadata_service_pb2.SearchIndividualsResponse.SerializeToString, } method_implementations = { ('ga4gh.BioMetadataService', 'GetBioSample'): face_utilities.unary_unary_inline(servicer.GetBioSample), ('ga4gh.BioMetadataService', 'GetIndividual'): face_utilities.unary_unary_inline(servicer.GetIndividual), ('ga4gh.BioMetadataService', 'SearchBioSamples'): face_utilities.unary_unary_inline(servicer.SearchBioSamples), ('ga4gh.BioMetadataService', 'SearchIndividuals'): face_utilities.unary_unary_inline(servicer.SearchIndividuals), } 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)
def beta_create_IPython_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 = { ('ipython.IPython', 'cancel'): CancelRequest.FromString, ('ipython.IPython', 'complete'): CompletionRequest.FromString, ('ipython.IPython', 'execute'): ExecuteRequest.FromString, ('ipython.IPython', 'status'): StatusRequest.FromString, ('ipython.IPython', 'stop'): StopRequest.FromString, } response_serializers = { ('ipython.IPython', 'cancel'): CancelResponse.SerializeToString, ('ipython.IPython', 'complete'): CompletionResponse.SerializeToString, ('ipython.IPython', 'execute'): ExecuteResponse.SerializeToString, ('ipython.IPython', 'status'): StatusResponse.SerializeToString, ('ipython.IPython', 'stop'): StopResponse.SerializeToString, } method_implementations = { ('ipython.IPython', 'cancel'): face_utilities.unary_unary_inline(servicer.cancel), ('ipython.IPython', 'complete'): face_utilities.unary_unary_inline(servicer.complete), ('ipython.IPython', 'execute'): face_utilities.unary_stream_inline(servicer.execute), ('ipython.IPython', 'status'): face_utilities.unary_unary_inline(servicer.status), ('ipython.IPython', 'stop'): face_utilities.unary_unary_inline(servicer.stop), } 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)
def beta_create_Datastore_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('google.datastore.v1beta3.Datastore', 'AllocateIds'): AllocateIdsRequest.FromString, ('google.datastore.v1beta3.Datastore', 'BeginTransaction'): BeginTransactionRequest.FromString, ('google.datastore.v1beta3.Datastore', 'Commit'): CommitRequest.FromString, ('google.datastore.v1beta3.Datastore', 'Lookup'): LookupRequest.FromString, ('google.datastore.v1beta3.Datastore', 'Rollback'): RollbackRequest.FromString, ('google.datastore.v1beta3.Datastore', 'RunQuery'): RunQueryRequest.FromString, } response_serializers = { ('google.datastore.v1beta3.Datastore', 'AllocateIds'): AllocateIdsResponse.SerializeToString, ('google.datastore.v1beta3.Datastore', 'BeginTransaction'): BeginTransactionResponse.SerializeToString, ('google.datastore.v1beta3.Datastore', 'Commit'): CommitResponse.SerializeToString, ('google.datastore.v1beta3.Datastore', 'Lookup'): LookupResponse.SerializeToString, ('google.datastore.v1beta3.Datastore', 'Rollback'): RollbackResponse.SerializeToString, ('google.datastore.v1beta3.Datastore', 'RunQuery'): RunQueryResponse.SerializeToString, } method_implementations = { ('google.datastore.v1beta3.Datastore', 'AllocateIds'): face_utilities.unary_unary_inline(servicer.AllocateIds), ('google.datastore.v1beta3.Datastore', 'BeginTransaction'): face_utilities.unary_unary_inline(servicer.BeginTransaction), ('google.datastore.v1beta3.Datastore', 'Commit'): face_utilities.unary_unary_inline(servicer.Commit), ('google.datastore.v1beta3.Datastore', 'Lookup'): face_utilities.unary_unary_inline(servicer.Lookup), ('google.datastore.v1beta3.Datastore', 'Rollback'): face_utilities.unary_unary_inline(servicer.Rollback), ('google.datastore.v1beta3.Datastore', 'RunQuery'): face_utilities.unary_unary_inline(servicer.RunQuery), } 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)
def beta_create_MetricsServiceV2_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.logging.v2.logging_metrics_pb2 import google.protobuf.empty_pb2 request_deserializers = { ('google.logging.v2.MetricsServiceV2', 'CreateLogMetric'): google.logging.v2.logging_metrics_pb2.CreateLogMetricRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'DeleteLogMetric'): google.logging.v2.logging_metrics_pb2.DeleteLogMetricRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'GetLogMetric'): google.logging.v2.logging_metrics_pb2.GetLogMetricRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'ListLogMetrics'): google.logging.v2.logging_metrics_pb2.ListLogMetricsRequest.FromString, ('google.logging.v2.MetricsServiceV2', 'UpdateLogMetric'): google.logging.v2.logging_metrics_pb2.UpdateLogMetricRequest.FromString, } response_serializers = { ('google.logging.v2.MetricsServiceV2', 'CreateLogMetric'): google.logging.v2.logging_metrics_pb2.LogMetric.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'DeleteLogMetric'): google.protobuf.empty_pb2.Empty.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'GetLogMetric'): google.logging.v2.logging_metrics_pb2.LogMetric.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'ListLogMetrics'): google.logging.v2.logging_metrics_pb2.ListLogMetricsResponse.SerializeToString, ('google.logging.v2.MetricsServiceV2', 'UpdateLogMetric'): google.logging.v2.logging_metrics_pb2.LogMetric.SerializeToString, } method_implementations = { ('google.logging.v2.MetricsServiceV2', 'CreateLogMetric'): face_utilities.unary_unary_inline(servicer.CreateLogMetric), ('google.logging.v2.MetricsServiceV2', 'DeleteLogMetric'): face_utilities.unary_unary_inline(servicer.DeleteLogMetric), ('google.logging.v2.MetricsServiceV2', 'GetLogMetric'): face_utilities.unary_unary_inline(servicer.GetLogMetric), ('google.logging.v2.MetricsServiceV2', 'ListLogMetrics'): face_utilities.unary_unary_inline(servicer.ListLogMetrics), ('google.logging.v2.MetricsServiceV2', 'UpdateLogMetric'): face_utilities.unary_unary_inline(servicer.UpdateLogMetric), } 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)
def beta_create_CloudWindmillServiceV1Alpha1_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import windmill_pb2 import windmill_pb2 import windmill_pb2 import windmill_pb2 import windmill_pb2 import windmill_pb2 import windmill_pb2 import windmill_pb2 import windmill_pb2 import windmill_pb2 request_deserializers = { ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'CommitWork'): windmill_pb2.CommitWorkRequest.FromString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetConfig'): windmill_pb2.GetConfigRequest.FromString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetData'): windmill_pb2.GetDataRequest.FromString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetWork'): windmill_pb2.GetWorkRequest.FromString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'ReportStats'): windmill_pb2.ReportStatsRequest.FromString, } response_serializers = { ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'CommitWork'): windmill_pb2.CommitWorkResponse.SerializeToString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetConfig'): windmill_pb2.GetConfigResponse.SerializeToString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetData'): windmill_pb2.GetDataResponse.SerializeToString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetWork'): windmill_pb2.GetWorkResponse.SerializeToString, ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'ReportStats'): windmill_pb2.ReportStatsResponse.SerializeToString, } method_implementations = { ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'CommitWork'): face_utilities.unary_unary_inline(servicer.CommitWork), ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetConfig'): face_utilities.unary_unary_inline(servicer.GetConfig), ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetData'): face_utilities.unary_unary_inline(servicer.GetData), ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'GetWork'): face_utilities.unary_unary_inline(servicer.GetWork), ('google.dataflow.windmillservice.v1alpha1.CloudWindmillServiceV1Alpha1', 'ReportStats'): face_utilities.unary_unary_inline(servicer.ReportStats), } 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)
def beta_create_Bigtable_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('google.bigtable.v2.Bigtable', 'CheckAndMutateRow'): CheckAndMutateRowRequest.FromString, ('google.bigtable.v2.Bigtable', 'MutateRow'): MutateRowRequest.FromString, ('google.bigtable.v2.Bigtable', 'MutateRows'): MutateRowsRequest.FromString, ('google.bigtable.v2.Bigtable', 'ReadModifyWriteRow'): ReadModifyWriteRowRequest.FromString, ('google.bigtable.v2.Bigtable', 'ReadRows'): ReadRowsRequest.FromString, ('google.bigtable.v2.Bigtable', 'SampleRowKeys'): SampleRowKeysRequest.FromString, } response_serializers = { ('google.bigtable.v2.Bigtable', 'CheckAndMutateRow'): CheckAndMutateRowResponse.SerializeToString, ('google.bigtable.v2.Bigtable', 'MutateRow'): MutateRowResponse.SerializeToString, ('google.bigtable.v2.Bigtable', 'MutateRows'): MutateRowsResponse.SerializeToString, ('google.bigtable.v2.Bigtable', 'ReadModifyWriteRow'): ReadModifyWriteRowResponse.SerializeToString, ('google.bigtable.v2.Bigtable', 'ReadRows'): ReadRowsResponse.SerializeToString, ('google.bigtable.v2.Bigtable', 'SampleRowKeys'): SampleRowKeysResponse.SerializeToString, } method_implementations = { ('google.bigtable.v2.Bigtable', 'CheckAndMutateRow'): face_utilities.unary_unary_inline(servicer.CheckAndMutateRow), ('google.bigtable.v2.Bigtable', 'MutateRow'): face_utilities.unary_unary_inline(servicer.MutateRow), ('google.bigtable.v2.Bigtable', 'MutateRows'): face_utilities.unary_stream_inline(servicer.MutateRows), ('google.bigtable.v2.Bigtable', 'ReadModifyWriteRow'): face_utilities.unary_unary_inline(servicer.ReadModifyWriteRow), ('google.bigtable.v2.Bigtable', 'ReadRows'): face_utilities.unary_stream_inline(servicer.ReadRows), ('google.bigtable.v2.Bigtable', 'SampleRowKeys'): face_utilities.unary_stream_inline(servicer.SampleRowKeys), } 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)
def beta_create_RouteGuide_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import route_guide_pb2 import route_guide_pb2 import route_guide_pb2 import route_guide_pb2 import route_guide_pb2 import route_guide_pb2 import route_guide_pb2 import route_guide_pb2 request_deserializers = { ('routeguide.RouteGuide', 'GetFeature'): route_guide_pb2.Point.FromString, ('routeguide.RouteGuide', 'ListFeatures'): route_guide_pb2.Rectangle.FromString, ('routeguide.RouteGuide', 'RecordRoute'): route_guide_pb2.Point.FromString, ('routeguide.RouteGuide', 'RouteChat'): route_guide_pb2.RouteNote.FromString, } response_serializers = { ('routeguide.RouteGuide', 'GetFeature'): route_guide_pb2.Feature.SerializeToString, ('routeguide.RouteGuide', 'ListFeatures'): route_guide_pb2.Feature.SerializeToString, ('routeguide.RouteGuide', 'RecordRoute'): route_guide_pb2.RouteSummary.SerializeToString, ('routeguide.RouteGuide', 'RouteChat'): route_guide_pb2.RouteNote.SerializeToString, } method_implementations = { ('routeguide.RouteGuide', 'GetFeature'): face_utilities.unary_unary_inline(servicer.GetFeature), ('routeguide.RouteGuide', 'ListFeatures'): face_utilities.unary_stream_inline(servicer.ListFeatures), ('routeguide.RouteGuide', 'RecordRoute'): face_utilities.stream_unary_inline(servicer.RecordRoute), ('routeguide.RouteGuide', 'RouteChat'): face_utilities.stream_stream_inline(servicer.RouteChat), } 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)
def instantiate( self, methods, method_implementations, multi_method_implementation): serialization_behaviors = _serialization_behaviors_from_test_methods( methods) # TODO(nathaniel): Add a "groups" attribute to _digest.TestServiceDigest. service = next(iter(methods))[0] # TODO(nathaniel): Add a "cardinalities_by_group" attribute to # _digest.TestServiceDigest. cardinalities = { method: method_object.cardinality() for (group, method), method_object in six.iteritems(methods)} server_options = implementations.server_options( request_deserializers=serialization_behaviors.request_deserializers, response_serializers=serialization_behaviors.response_serializers, thread_pool_size=test_constants.POOL_SIZE) server = implementations.server( method_implementations, options=server_options) server_credentials = implementations.ssl_server_credentials( [(resources.private_key(), resources.certificate_chain(),),]) port = server.add_secure_port('[::]:0', server_credentials) server.start() channel_credentials = implementations.ssl_channel_credentials( resources.test_root_certificates()) channel = test_utilities.not_really_secure_channel( 'localhost', port, channel_credentials, _SERVER_HOST_OVERRIDE) stub_options = implementations.stub_options( request_serializers=serialization_behaviors.request_serializers, response_deserializers=serialization_behaviors.response_deserializers, thread_pool_size=test_constants.POOL_SIZE) generic_stub = implementations.generic_stub(channel, options=stub_options) dynamic_stub = implementations.dynamic_stub( channel, service, cardinalities, options=stub_options) return generic_stub, {service: dynamic_stub}, server
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', 'Classify'): tensorflow__serving_dot_apis_dot_classification__pb2.ClassificationRequest.FromString, ('tensorflow.serving.PredictionService', 'GetModelMetadata'): tensorflow__serving_dot_apis_dot_get__model__metadata__pb2.GetModelMetadataRequest.FromString, ('tensorflow.serving.PredictionService', 'Predict'): tensorflow__serving_dot_apis_dot_predict__pb2.PredictRequest.FromString, ('tensorflow.serving.PredictionService', 'Regress'): tensorflow__serving_dot_apis_dot_regression__pb2.RegressionRequest.FromString, } response_serializers = { ('tensorflow.serving.PredictionService', 'Classify'): tensorflow__serving_dot_apis_dot_classification__pb2.ClassificationResponse.SerializeToString, ('tensorflow.serving.PredictionService', 'GetModelMetadata'): tensorflow__serving_dot_apis_dot_get__model__metadata__pb2.GetModelMetadataResponse.SerializeToString, ('tensorflow.serving.PredictionService', 'Predict'): tensorflow__serving_dot_apis_dot_predict__pb2.PredictResponse.SerializeToString, ('tensorflow.serving.PredictionService', 'Regress'): tensorflow__serving_dot_apis_dot_regression__pb2.RegressionResponse.SerializeToString, } method_implementations = { ('tensorflow.serving.PredictionService', 'Classify'): face_utilities.unary_unary_inline(servicer.Classify), ('tensorflow.serving.PredictionService', 'GetModelMetadata'): face_utilities.unary_unary_inline(servicer.GetModelMetadata), ('tensorflow.serving.PredictionService', 'Predict'): face_utilities.unary_unary_inline(servicer.Predict), ('tensorflow.serving.PredictionService', 'Regress'): face_utilities.unary_unary_inline(servicer.Regress), } 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)
def beta_create_VariantService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('ga4gh.VariantService', 'GetCallSet'): GetCallSetRequest.FromString, ('ga4gh.VariantService', 'GetVariant'): GetVariantRequest.FromString, ('ga4gh.VariantService', 'GetVariantSet'): GetVariantSetRequest.FromString, ('ga4gh.VariantService', 'SearchCallSets'): SearchCallSetsRequest.FromString, ('ga4gh.VariantService', 'SearchVariantSets'): SearchVariantSetsRequest.FromString, ('ga4gh.VariantService', 'SearchVariants'): SearchVariantsRequest.FromString, } response_serializers = { ('ga4gh.VariantService', 'GetCallSet'): ga4gh_dot_variants__pb2.CallSet.SerializeToString, ('ga4gh.VariantService', 'GetVariant'): ga4gh_dot_variants__pb2.Variant.SerializeToString, ('ga4gh.VariantService', 'GetVariantSet'): ga4gh_dot_variants__pb2.VariantSet.SerializeToString, ('ga4gh.VariantService', 'SearchCallSets'): SearchCallSetsResponse.SerializeToString, ('ga4gh.VariantService', 'SearchVariantSets'): SearchVariantSetsResponse.SerializeToString, ('ga4gh.VariantService', 'SearchVariants'): ga4gh_dot_variants__pb2.Variant.SerializeToString, } method_implementations = { ('ga4gh.VariantService', 'GetCallSet'): face_utilities.unary_unary_inline(servicer.GetCallSet), ('ga4gh.VariantService', 'GetVariant'): face_utilities.unary_unary_inline(servicer.GetVariant), ('ga4gh.VariantService', 'GetVariantSet'): face_utilities.unary_unary_inline(servicer.GetVariantSet), ('ga4gh.VariantService', 'SearchCallSets'): face_utilities.unary_unary_inline(servicer.SearchCallSets), ('ga4gh.VariantService', 'SearchVariantSets'): face_utilities.unary_unary_inline(servicer.SearchVariantSets), ('ga4gh.VariantService', 'SearchVariants'): face_utilities.unary_stream_inline(servicer.SearchVariants), } 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)
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)
def beta_create_ReportErrorsService_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 = { ('google.devtools.clouderrorreporting.v1beta1.ReportErrorsService', 'ReportErrorEvent'): ReportErrorEventRequest.FromString, } response_serializers = { ('google.devtools.clouderrorreporting.v1beta1.ReportErrorsService', 'ReportErrorEvent'): ReportErrorEventResponse.SerializeToString, } method_implementations = { ('google.devtools.clouderrorreporting.v1beta1.ReportErrorsService', 'ReportErrorEvent'): face_utilities.unary_unary_inline(servicer.ReportErrorEvent), } 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)
def beta_create_Elastic_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 = { ('dstore.elastic.Elastic', 'ItemExport'): dstore_dot_elastic_dot_item_dot_item__export__pb2.Request.FromString, ('dstore.elastic.Elastic', 'ItemGet'): dstore_dot_elastic_dot_item_dot_item__get__pb2.Request.FromString, ('dstore.elastic.Elastic', 'ItemSuggest'): dstore_dot_elastic_dot_item_dot_item__suggest__pb2.Request.FromString, } response_serializers = { ('dstore.elastic.Elastic', 'ItemExport'): dstore_dot_elastic_dot_item_dot_item__export__pb2.Response. SerializeToString, ('dstore.elastic.Elastic', 'ItemGet'): dstore_dot_elastic_dot_item_dot_item__get__pb2.Response. SerializeToString, ('dstore.elastic.Elastic', 'ItemSuggest'): dstore_dot_elastic_dot_item_dot_item__suggest__pb2.Response. SerializeToString, } method_implementations = { ('dstore.elastic.Elastic', 'ItemExport'): face_utilities.unary_stream_inline(servicer.ItemExport), ('dstore.elastic.Elastic', 'ItemGet'): face_utilities.unary_stream_inline(servicer.ItemGet), ('dstore.elastic.Elastic', 'ItemSuggest'): face_utilities.unary_unary_inline(servicer.ItemSuggest), } 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)
def beta_create_RemoteCommand_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 = { ('gcommand.RemoteCommand', 'ExecCommand'): Command.FromString, } response_serializers = { ('gcommand.RemoteCommand', 'ExecCommand'): ReturnMsg.SerializeToString, } method_implementations = { ('gcommand.RemoteCommand', 'ExecCommand'): face_utilities.unary_unary_inline(servicer.ExecCommand), } 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)
def beta_create_OnlinePredictionService_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 = { ('google.cloud.ml.v1.OnlinePredictionService', 'Predict'): PredictRequest.FromString, } response_serializers = { ('google.cloud.ml.v1.OnlinePredictionService', 'Predict'): google_dot_api_dot_httpbody__pb2.HttpBody.SerializeToString, } method_implementations = { ('google.cloud.ml.v1.OnlinePredictionService', '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)
def beta_create_IPython_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 = { ('ipython.IPython', 'cancel'): CancelRequest.FromString, ('ipython.IPython', 'complete'): CompletionRequest.FromString, ('ipython.IPython', 'execute'): ExecuteRequest.FromString, ('ipython.IPython', 'status'): StatusRequest.FromString, ('ipython.IPython', 'stop'): StopRequest.FromString, } response_serializers = { ('ipython.IPython', 'cancel'): CancelResponse.SerializeToString, ('ipython.IPython', 'complete'): CompletionResponse.SerializeToString, ('ipython.IPython', 'execute'): ExecuteResponse.SerializeToString, ('ipython.IPython', 'status'): StatusResponse.SerializeToString, ('ipython.IPython', 'stop'): StopResponse.SerializeToString, } method_implementations = { ('ipython.IPython', 'cancel'): face_utilities.unary_unary_inline(servicer.cancel), ('ipython.IPython', 'complete'): face_utilities.unary_unary_inline(servicer.complete), ('ipython.IPython', 'execute'): face_utilities.unary_stream_inline(servicer.execute), ('ipython.IPython', 'status'): face_utilities.unary_unary_inline(servicer.status), ('ipython.IPython', 'stop'): face_utilities.unary_unary_inline(servicer.stop), } 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)
def beta_create_Processor_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 = { ('fleetspeak.grpcservice.Processor', 'Process'): fleetspeak_dot_src_dot_common_dot_proto_dot_fleetspeak_dot_common__pb2.Message.FromString, } response_serializers = { ('fleetspeak.grpcservice.Processor', 'Process'): fleetspeak_dot_src_dot_common_dot_proto_dot_fleetspeak_dot_common__pb2.EmptyMessage.SerializeToString, } method_implementations = { ('fleetspeak.grpcservice.Processor', 'Process'): face_utilities.unary_unary_inline(servicer.Process), } 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)
def beta_create_Endorser_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 = { ('protos.Endorser', 'ProcessProposal'): peer_dot_fabric__proposal__pb2.SignedProposal.FromString, } response_serializers = { ('protos.Endorser', 'ProcessProposal'): peer_dot_fabric__proposal__response__pb2.ProposalResponse.SerializeToString, } method_implementations = { ('protos.Endorser', 'ProcessProposal'): face_utilities.unary_unary_inline(servicer.ProcessProposal), } 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)
def beta_create_Phenopipe_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 = { ('phenopipe.Phenopipe', 'WatchJob'): WatchJobRequest.FromString, } response_serializers = { ('phenopipe.Phenopipe', 'WatchJob'): ProgressResponse.SerializeToString, } method_implementations = { ('phenopipe.Phenopipe', 'WatchJob'): face_utilities.unary_stream_inline(servicer.WatchJob), } 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)
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', 'Chat'): Number.FromString, ('Calculator', 'ReceiveEvents'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, ('Calculator', 'SendEvents'): Number.FromString, ('Calculator', 'SquareRoot'): Number.FromString, } response_serializers = { ('Calculator', 'Chat'): Number.SerializeToString, ('Calculator', 'ReceiveEvents'): Number.SerializeToString, ('Calculator', 'SendEvents'): Number.SerializeToString, ('Calculator', 'SquareRoot'): Number.SerializeToString, } method_implementations = { ('Calculator', 'Chat'): face_utilities.stream_stream_inline(servicer.Chat), ('Calculator', 'ReceiveEvents'): face_utilities.unary_stream_inline(servicer.ReceiveEvents), ('Calculator', 'SendEvents'): face_utilities.stream_unary_inline(servicer.SendEvents), ('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)
def beta_create_DataProvider_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 = { ('augServer.DataProvider', 'Control'): ControlSignal.FromString, ('augServer.DataProvider', 'GetStatus'): Empty.FromString, ('augServer.DataProvider', 'GetTestData'): Empty.FromString, ('augServer.DataProvider', 'GetTrainData'): Empty.FromString, } response_serializers = { ('augServer.DataProvider', 'Control'): ControlResponse.SerializeToString, ('augServer.DataProvider', 'GetStatus'): Status.SerializeToString, ('augServer.DataProvider', 'GetTestData'): BatchData.SerializeToString, ('augServer.DataProvider', 'GetTrainData'): BatchData.SerializeToString, } method_implementations = { ('augServer.DataProvider', 'Control'): face_utilities.unary_unary_inline(servicer.Control), ('augServer.DataProvider', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus), ('augServer.DataProvider', 'GetTestData'): face_utilities.unary_unary_inline(servicer.GetTestData), ('augServer.DataProvider', 'GetTrainData'): face_utilities.unary_unary_inline(servicer.GetTrainData), } 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)
def setUp(self): self._servicer = _Servicer() method_implementations = { (_GROUP, _UNARY_UNARY): utilities.unary_unary_inline(self._servicer.unary_unary), (_GROUP, _UNARY_STREAM): utilities.unary_stream_inline(self._servicer.unary_stream), (_GROUP, _STREAM_UNARY): utilities.stream_unary_inline(self._servicer.stream_unary), (_GROUP, _STREAM_STREAM): utilities.stream_stream_inline(self._servicer.stream_stream), } cardinalities = { _UNARY_UNARY: cardinality.Cardinality.UNARY_UNARY, _UNARY_STREAM: cardinality.Cardinality.UNARY_STREAM, _STREAM_UNARY: cardinality.Cardinality.STREAM_UNARY, _STREAM_STREAM: cardinality.Cardinality.STREAM_STREAM, } server_options = implementations.server_options( thread_pool_size=test_constants.POOL_SIZE) self._server = implementations.server(method_implementations, options=server_options) server_credentials = implementations.ssl_server_credentials([ ( resources.private_key(), resources.certificate_chain(), ), ]) port = self._server.add_secure_port('[::]:0', server_credentials) self._server.start() self._channel_credentials = implementations.ssl_channel_credentials( resources.test_root_certificates()) self._call_credentials = implementations.metadata_call_credentials( _metadata_plugin) channel = test_utilities.not_really_secure_channel( 'localhost', port, self._channel_credentials, _SERVER_HOST_OVERRIDE) stub_options = implementations.stub_options( thread_pool_size=test_constants.POOL_SIZE) self._dynamic_stub = implementations.dynamic_stub(channel, _GROUP, cardinalities, options=stub_options)
def beta_create_LoggingServiceV2_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('google.logging.v2.LoggingServiceV2', 'DeleteLog'): DeleteLogRequest.FromString, ('google.logging.v2.LoggingServiceV2', 'ListLogEntries'): ListLogEntriesRequest.FromString, ('google.logging.v2.LoggingServiceV2', 'ListMonitoredResourceDescriptors'): ListMonitoredResourceDescriptorsRequest.FromString, ('google.logging.v2.LoggingServiceV2', 'WriteLogEntries'): WriteLogEntriesRequest.FromString, } response_serializers = { ('google.logging.v2.LoggingServiceV2', 'DeleteLog'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ('google.logging.v2.LoggingServiceV2', 'ListLogEntries'): ListLogEntriesResponse.SerializeToString, ('google.logging.v2.LoggingServiceV2', 'ListMonitoredResourceDescriptors'): ListMonitoredResourceDescriptorsResponse.SerializeToString, ('google.logging.v2.LoggingServiceV2', 'WriteLogEntries'): WriteLogEntriesResponse.SerializeToString, } method_implementations = { ('google.logging.v2.LoggingServiceV2', 'DeleteLog'): face_utilities.unary_unary_inline(servicer.DeleteLog), ('google.logging.v2.LoggingServiceV2', 'ListLogEntries'): face_utilities.unary_unary_inline(servicer.ListLogEntries), ('google.logging.v2.LoggingServiceV2', 'ListMonitoredResourceDescriptors'): face_utilities.unary_unary_inline( servicer.ListMonitoredResourceDescriptors), ('google.logging.v2.LoggingServiceV2', 'WriteLogEntries'): face_utilities.unary_unary_inline(servicer.WriteLogEntries), } 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)
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.Calculator', 'Add'): CalculateRequest.FromString, ('calculator.Calculator', 'Divide'): CalculateRequest.FromString, ('calculator.Calculator', 'Multiply'): CalculateRequest.FromString, ('calculator.Calculator', 'Subtract'): CalculateRequest.FromString, } response_serializers = { ('calculator.Calculator', 'Add'): CalculateResponse.SerializeToString, ('calculator.Calculator', 'Divide'): CalculateResponse.SerializeToString, ('calculator.Calculator', 'Multiply'): CalculateResponse.SerializeToString, ('calculator.Calculator', 'Subtract'): CalculateResponse.SerializeToString, } method_implementations = { ('calculator.Calculator', 'Add'): face_utilities.unary_unary_inline(servicer.Add), ('calculator.Calculator', 'Divide'): face_utilities.unary_unary_inline(servicer.Divide), ('calculator.Calculator', 'Multiply'): face_utilities.unary_unary_inline(servicer.Multiply), ('calculator.Calculator', 'Subtract'): face_utilities.unary_unary_inline(servicer.Subtract), } 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)
def beta_create_Bridge_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 = { ('Bridge', 'GetX'): NullMessage.FromString, ('Bridge', 'Init'): NullMessage.FromString, ('Bridge', 'Run'): Item.FromString, ('Bridge', 'SetX'): X.FromString, ('Bridge', 'StoreMetric'): Item.FromString, } response_serializers = { ('Bridge', 'GetX'): X.SerializeToString, ('Bridge', 'Init'): NullMessage.SerializeToString, ('Bridge', 'Run'): Item.SerializeToString, ('Bridge', 'SetX'): NullMessage.SerializeToString, ('Bridge', 'StoreMetric'): NullMessage.SerializeToString, } method_implementations = { ('Bridge', 'GetX'): face_utilities.unary_unary_inline(servicer.GetX), ('Bridge', 'Init'): face_utilities.unary_unary_inline(servicer.Init), ('Bridge', 'Run'): face_utilities.stream_stream_inline(servicer.Run), ('Bridge', 'SetX'): face_utilities.unary_unary_inline(servicer.SetX), ('Bridge', 'StoreMetric'): face_utilities.stream_unary_inline(servicer.StoreMetric), } 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)
def beta_create_Projects_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('monorail.Projects', 'ListProjects'): ListProjectsRequest.FromString, ('monorail.Projects', 'PatchProjectConfiguredLabels'): PatchProjectConfiguredLabelsRequest.FromString, ('monorail.Projects', 'UpdateProjectConfiguredLabels'): UpdateProjectConfiguredLabelsRequest.FromString, } response_serializers = { ('monorail.Projects', 'ListProjects'): ListProjectsResponse.SerializeToString, ('monorail.Projects', 'PatchProjectConfiguredLabels'): Labels.SerializeToString, ('monorail.Projects', 'UpdateProjectConfiguredLabels'): Labels.SerializeToString, } method_implementations = { ('monorail.Projects', 'ListProjects'): face_utilities.unary_unary_inline(servicer.ListProjects), ('monorail.Projects', 'PatchProjectConfiguredLabels'): face_utilities.unary_unary_inline(servicer.PatchProjectConfiguredLabels), ('monorail.Projects', 'UpdateProjectConfiguredLabels'): face_utilities.unary_unary_inline(servicer.UpdateProjectConfiguredLabels), } 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)
def beta_create_FileService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('luci.swarming.bot.FileService', 'Contains'): ContainsRequest.FromString, ('luci.swarming.bot.FileService', 'FetchBlobs'): FetchBlobsRequest.FromString, ('luci.swarming.bot.FileService', 'PushBlobs'): PushBlobsRequest.FromString, } response_serializers = { ('luci.swarming.bot.FileService', 'Contains'): ContainsReply.SerializeToString, ('luci.swarming.bot.FileService', 'FetchBlobs'): FetchBlobsReply.SerializeToString, ('luci.swarming.bot.FileService', 'PushBlobs'): PushBlobsReply.SerializeToString, } method_implementations = { ('luci.swarming.bot.FileService', 'Contains'): face_utilities.unary_unary_inline(servicer.Contains), ('luci.swarming.bot.FileService', 'FetchBlobs'): face_utilities.unary_stream_inline(servicer.FetchBlobs), ('luci.swarming.bot.FileService', 'PushBlobs'): face_utilities.stream_unary_inline(servicer.PushBlobs), } 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)
def beta_create_Admin_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import google.protobuf.empty_pb2 import server_admin_pb2 import google.protobuf.empty_pb2 import server_admin_pb2 import google.protobuf.empty_pb2 import server_admin_pb2 request_deserializers = { ('protos.Admin', 'GetStatus'): google.protobuf.empty_pb2.Empty.FromString, ('protos.Admin', 'StartServer'): google.protobuf.empty_pb2.Empty.FromString, ('protos.Admin', 'StopServer'): google.protobuf.empty_pb2.Empty.FromString, } response_serializers = { ('protos.Admin', 'GetStatus'): server_admin_pb2.ServerStatus.SerializeToString, ('protos.Admin', 'StartServer'): server_admin_pb2.ServerStatus.SerializeToString, ('protos.Admin', 'StopServer'): server_admin_pb2.ServerStatus.SerializeToString, } method_implementations = { ('protos.Admin', 'GetStatus'): face_utilities.unary_unary_inline(servicer.GetStatus), ('protos.Admin', 'StartServer'): face_utilities.unary_unary_inline(servicer.StartServer), ('protos.Admin', 'StopServer'): face_utilities.unary_unary_inline(servicer.StopServer), } 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)
def instantiate(self, methods, method_implementations, multi_method_implementation): serialization_behaviors = _serialization_behaviors_from_test_methods( methods) # TODO(nathaniel): Add a "groups" attribute to _digest.TestServiceDigest. service = next(iter(methods))[0] # TODO(nathaniel): Add a "cardinalities_by_group" attribute to # _digest.TestServiceDigest. cardinalities = { method: method_object.cardinality() for (group, method), method_object in six.iteritems(methods) } server_options = implementations.server_options( request_deserializers=serialization_behaviors. request_deserializers, response_serializers=serialization_behaviors.response_serializers, thread_pool_size=test_constants.POOL_SIZE) server = implementations.server(method_implementations, options=server_options) server_credentials = implementations.ssl_server_credentials([ ( resources.private_key(), resources.certificate_chain(), ), ]) port = server.add_secure_port('[::]:0', server_credentials) server.start() channel_credentials = implementations.ssl_channel_credentials( resources.test_root_certificates()) channel = test_utilities.not_really_secure_channel( 'localhost', port, channel_credentials, _SERVER_HOST_OVERRIDE) stub_options = implementations.stub_options( request_serializers=serialization_behaviors.request_serializers, response_deserializers=serialization_behaviors. response_deserializers, thread_pool_size=test_constants.POOL_SIZE) generic_stub = implementations.generic_stub(channel, options=stub_options) dynamic_stub = implementations.dynamic_stub(channel, service, cardinalities, options=stub_options) return generic_stub, {service: dynamic_stub}, server
def beta_create_DroneConnect_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 = { ('droneconnect.DroneConnect', 'getAutopilotInfo'): UavIdentifier.FromString, ('droneconnect.DroneConnect', 'getPosition'): Null.FromString, ('droneconnect.DroneConnect', 'getSafety'): Null.FromString, ('droneconnect.DroneConnect', 'hasMode'): Null.FromString, ('droneconnect.DroneConnect', 'isArmed'): Null.FromString, ('droneconnect.DroneConnect', 'setArmed'): Armed.FromString, ('droneconnect.DroneConnect', 'setMode'): Mode.FromString, ('droneconnect.DroneConnect', 'setPath'): Position.FromString, ('droneconnect.DroneConnect', 'setSafety'): Safety.FromString, ('droneconnect.DroneConnect', 'takeoff'): TakeoffToAltitude.FromString, } response_serializers = { ('droneconnect.DroneConnect', 'getAutopilotInfo'): AutopilotInfo.SerializeToString, ('droneconnect.DroneConnect', 'getPosition'): Position.SerializeToString, ('droneconnect.DroneConnect', 'getSafety'): Safety.SerializeToString, ('droneconnect.DroneConnect', 'hasMode'): Mode.SerializeToString, ('droneconnect.DroneConnect', 'isArmed'): Armed.SerializeToString, ('droneconnect.DroneConnect', 'setArmed'): Null.SerializeToString, ('droneconnect.DroneConnect', 'setMode'): Null.SerializeToString, ('droneconnect.DroneConnect', 'setPath'): Null.SerializeToString, ('droneconnect.DroneConnect', 'setSafety'): Null.SerializeToString, ('droneconnect.DroneConnect', 'takeoff'): Position.SerializeToString, } method_implementations = { ('droneconnect.DroneConnect', 'getAutopilotInfo'): face_utilities.unary_unary_inline(servicer.getAutopilotInfo), ('droneconnect.DroneConnect', 'getPosition'): face_utilities.unary_unary_inline(servicer.getPosition), ('droneconnect.DroneConnect', 'getSafety'): face_utilities.unary_unary_inline(servicer.getSafety), ('droneconnect.DroneConnect', 'hasMode'): face_utilities.unary_unary_inline(servicer.hasMode), ('droneconnect.DroneConnect', 'isArmed'): face_utilities.unary_unary_inline(servicer.isArmed), ('droneconnect.DroneConnect', 'setArmed'): face_utilities.unary_unary_inline(servicer.setArmed), ('droneconnect.DroneConnect', 'setMode'): face_utilities.unary_unary_inline(servicer.setMode), ('droneconnect.DroneConnect', 'setPath'): face_utilities.stream_unary_inline(servicer.setPath), ('droneconnect.DroneConnect', 'setSafety'): face_utilities.unary_unary_inline(servicer.setSafety), ('droneconnect.DroneConnect', 'takeoff'): face_utilities.unary_unary_inline(servicer.takeoff), } 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)
def beta_create_ScootDaemon_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('protocol.ScootDaemon', 'CheckoutSnapshot'): CheckoutSnapshotRequest.FromString, ('protocol.ScootDaemon', 'CreateSnapshot'): CreateSnapshotRequest.FromString, ('protocol.ScootDaemon', 'Echo'): EchoRequest.FromString, ('protocol.ScootDaemon', 'Poll'): PollRequest.FromString, ('protocol.ScootDaemon', 'Run'): RunRequest.FromString, } response_serializers = { ('protocol.ScootDaemon', 'CheckoutSnapshot'): CheckoutSnapshotReply.SerializeToString, ('protocol.ScootDaemon', 'CreateSnapshot'): CreateSnapshotReply.SerializeToString, ('protocol.ScootDaemon', 'Echo'): EchoReply.SerializeToString, ('protocol.ScootDaemon', 'Poll'): PollReply.SerializeToString, ('protocol.ScootDaemon', 'Run'): RunReply.SerializeToString, } method_implementations = { ('protocol.ScootDaemon', 'CheckoutSnapshot'): face_utilities.unary_unary_inline(servicer.CheckoutSnapshot), ('protocol.ScootDaemon', 'CreateSnapshot'): face_utilities.unary_unary_inline(servicer.CreateSnapshot), ('protocol.ScootDaemon', 'Echo'): face_utilities.unary_unary_inline(servicer.Echo), ('protocol.ScootDaemon', 'Poll'): face_utilities.unary_unary_inline(servicer.Poll), ('protocol.ScootDaemon', 'Run'): face_utilities.unary_unary_inline(servicer.Run), } 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)
def beta_create_SpiderServer_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 = { ('DistributeSpider.SpiderServer', 'keepalive'): Register.FromString, ('DistributeSpider.SpiderServer', 'req'): Request.FromString, ('DistributeSpider.SpiderServer', 'save'): House.FromString, ('DistributeSpider.SpiderServer', 'wait'): Wait.FromString, } response_serializers = { ('DistributeSpider.SpiderServer', 'keepalive'): UrlsAck.SerializeToString, ('DistributeSpider.SpiderServer', 'req'): Response.SerializeToString, ('DistributeSpider.SpiderServer', 'save'): Ack.SerializeToString, ('DistributeSpider.SpiderServer', 'wait'): Ack.SerializeToString, } method_implementations = { ('DistributeSpider.SpiderServer', 'keepalive'): face_utilities.unary_unary_inline(servicer.keepalive), ('DistributeSpider.SpiderServer', 'req'): face_utilities.unary_unary_inline(servicer.req), ('DistributeSpider.SpiderServer', 'save'): face_utilities.unary_unary_inline(servicer.save), ('DistributeSpider.SpiderServer', 'wait'): face_utilities.unary_unary_inline(servicer.wait), } 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)
def beta_create_Operations_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): request_deserializers = { ('google.longrunning.Operations', 'CancelOperation'): CancelOperationRequest.FromString, ('google.longrunning.Operations', 'DeleteOperation'): DeleteOperationRequest.FromString, ('google.longrunning.Operations', 'GetOperation'): GetOperationRequest.FromString, ('google.longrunning.Operations', 'ListOperations'): ListOperationsRequest.FromString, } response_serializers = { ('google.longrunning.Operations', 'CancelOperation'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ('google.longrunning.Operations', 'DeleteOperation'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ('google.longrunning.Operations', 'GetOperation'): Operation.SerializeToString, ('google.longrunning.Operations', 'ListOperations'): ListOperationsResponse.SerializeToString, } method_implementations = { ('google.longrunning.Operations', 'CancelOperation'): face_utilities.unary_unary_inline(servicer.CancelOperation), ('google.longrunning.Operations', 'DeleteOperation'): face_utilities.unary_unary_inline(servicer.DeleteOperation), ('google.longrunning.Operations', 'GetOperation'): face_utilities.unary_unary_inline(servicer.GetOperation), ('google.longrunning.Operations', 'ListOperations'): face_utilities.unary_unary_inline(servicer.ListOperations), } 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)
def beta_create_BigtableClusterService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_data_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import google.protobuf.empty_pb2 import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2 import google.longrunning.operations_pb2 request_deserializers = { ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'CreateCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.CreateClusterRequest.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.DeleteClusterRequest.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'GetCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.GetClusterRequest.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListClusters'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListClustersRequest.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListZones'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListZonesRequest.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UndeleteCluster'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.UndeleteClusterRequest.FromString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UpdateCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.FromString, } response_serializers = { ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'CreateCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): google.protobuf.empty_pb2.Empty.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'GetCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListClusters'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListClustersResponse.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListZones'): gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListZonesResponse.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UndeleteCluster'): google.longrunning.operations_pb2.Operation.SerializeToString, ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UpdateCluster'): gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString, } method_implementations = { ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'CreateCluster'): face_utilities.unary_unary_inline(servicer.CreateCluster), ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'DeleteCluster'): face_utilities.unary_unary_inline(servicer.DeleteCluster), ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'GetCluster'): face_utilities.unary_unary_inline(servicer.GetCluster), ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListClusters'): face_utilities.unary_unary_inline(servicer.ListClusters), ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'ListZones'): face_utilities.unary_unary_inline(servicer.ListZones), ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UndeleteCluster'): face_utilities.unary_unary_inline(servicer.UndeleteCluster), ('google.bigtable.admin.cluster.v1.BigtableClusterService', 'UpdateCluster'): face_utilities.unary_unary_inline(servicer.UpdateCluster), } 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)
def beta_create_UpdateStream_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import binlogdata_pb2 import binlogdata_pb2 import binlogdata_pb2 import binlogdata_pb2 import binlogdata_pb2 import binlogdata_pb2 request_deserializers = { ('binlogservice.UpdateStream', 'StreamKeyRange'): binlogdata_pb2.StreamKeyRangeRequest.FromString, ('binlogservice.UpdateStream', 'StreamTables'): binlogdata_pb2.StreamTablesRequest.FromString, ('binlogservice.UpdateStream', 'StreamUpdate'): binlogdata_pb2.StreamUpdateRequest.FromString, } response_serializers = { ('binlogservice.UpdateStream', 'StreamKeyRange'): binlogdata_pb2.StreamKeyRangeResponse.SerializeToString, ('binlogservice.UpdateStream', 'StreamTables'): binlogdata_pb2.StreamTablesResponse.SerializeToString, ('binlogservice.UpdateStream', 'StreamUpdate'): binlogdata_pb2.StreamUpdateResponse.SerializeToString, } method_implementations = { ('binlogservice.UpdateStream', 'StreamKeyRange'): face_utilities.unary_stream_inline(servicer.StreamKeyRange), ('binlogservice.UpdateStream', 'StreamTables'): face_utilities.unary_stream_inline(servicer.StreamTables), ('binlogservice.UpdateStream', 'StreamUpdate'): face_utilities.unary_stream_inline(servicer.StreamUpdate), } 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)
def beta_create_RouteGuide_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 = { ('routeguide.RouteGuide', 'GetFeature'): Point.FromString, ('routeguide.RouteGuide', 'ListFeatures'): Rectangle.FromString, ('routeguide.RouteGuide', 'RecordRoute'): Point.FromString, ('routeguide.RouteGuide', 'RouteChat'): RouteNote.FromString, } response_serializers = { ('routeguide.RouteGuide', 'GetFeature'): Feature.SerializeToString, ('routeguide.RouteGuide', 'ListFeatures'): Feature.SerializeToString, ('routeguide.RouteGuide', 'RecordRoute'): RouteSummary.SerializeToString, ('routeguide.RouteGuide', 'RouteChat'): RouteNote.SerializeToString, } method_implementations = { ('routeguide.RouteGuide', 'GetFeature'): face_utilities.unary_unary_inline(servicer.GetFeature), ('routeguide.RouteGuide', 'ListFeatures'): face_utilities.unary_stream_inline(servicer.ListFeatures), ('routeguide.RouteGuide', 'RecordRoute'): face_utilities.stream_unary_inline(servicer.RecordRoute), ('routeguide.RouteGuide', 'RouteChat'): face_utilities.stream_stream_inline(servicer.RouteChat), } 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)
def beta_create_MysqlCtl_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 import mysqlctl_pb2 request_deserializers = { ('mysqlctl.MysqlCtl', 'RunMysqlUpgrade'): mysqlctl_pb2.RunMysqlUpgradeRequest.FromString, ('mysqlctl.MysqlCtl', 'Shutdown'): mysqlctl_pb2.ShutdownRequest.FromString, ('mysqlctl.MysqlCtl', 'Start'): mysqlctl_pb2.StartRequest.FromString, } response_serializers = { ('mysqlctl.MysqlCtl', 'RunMysqlUpgrade'): mysqlctl_pb2.RunMysqlUpgradeResponse.SerializeToString, ('mysqlctl.MysqlCtl', 'Shutdown'): mysqlctl_pb2.ShutdownResponse.SerializeToString, ('mysqlctl.MysqlCtl', 'Start'): mysqlctl_pb2.StartResponse.SerializeToString, } method_implementations = { ('mysqlctl.MysqlCtl', 'RunMysqlUpgrade'): face_utilities.unary_unary_inline(servicer.RunMysqlUpgrade), ('mysqlctl.MysqlCtl', 'Shutdown'): face_utilities.unary_unary_inline(servicer.Shutdown), ('mysqlctl.MysqlCtl', 'Start'): face_utilities.unary_unary_inline(servicer.Start), } 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)
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', 'Category'): CategoryRequest.FromString, ('helloworld.Greeter', 'MakeModel'): MakeModelRequest.FromString, ('helloworld.Greeter', 'SayHello'): HelloRequest.FromString, ('helloworld.Greeter', 'SayHelloAgain'): HelloRequest.FromString, } response_serializers = { ('helloworld.Greeter', 'Category'): CategoryReply.SerializeToString, ('helloworld.Greeter', 'MakeModel'): MakeModelReply.SerializeToString, ('helloworld.Greeter', 'SayHello'): HelloReply.SerializeToString, ('helloworld.Greeter', 'SayHelloAgain'): HelloReply.SerializeToString, } method_implementations = { ('helloworld.Greeter', 'Category'): face_utilities.unary_unary_inline(servicer.Category), ('helloworld.Greeter', 'MakeModel'): face_utilities.unary_unary_inline(servicer.MakeModel), ('helloworld.Greeter', 'SayHello'): face_utilities.unary_unary_inline(servicer.SayHello), ('helloworld.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)
def beta_create_DataRetrieval_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import service_pb2 import service_pb2 import service_pb2 import service_pb2 import service_pb2 import service_pb2 request_deserializers = { ('exercise.DataRetrieval', 'GetDeck'): service_pb2.DeckRequest.FromString, ('exercise.DataRetrieval', 'GetDetailedUserDeck'): service_pb2.UserDeckRequest.FromString, ('exercise.DataRetrieval', 'GetUserDeck'): service_pb2.UserDeckRequest.FromString, } response_serializers = { ('exercise.DataRetrieval', 'GetDeck'): service_pb2.DeckResponse.SerializeToString, ('exercise.DataRetrieval', 'GetDetailedUserDeck'): service_pb2.UserDeckResponse.SerializeToString, ('exercise.DataRetrieval', 'GetUserDeck'): service_pb2.UserDeckResponse.SerializeToString, } method_implementations = { ('exercise.DataRetrieval', 'GetDeck'): face_utilities.unary_unary_inline(servicer.GetDeck), ('exercise.DataRetrieval', 'GetDetailedUserDeck'): face_utilities.unary_unary_inline(servicer.GetDetailedUserDeck), ('exercise.DataRetrieval', 'GetUserDeck'): face_utilities.unary_unary_inline(servicer.GetUserDeck), } 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)
def beta_create_BfKvService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 import bftrader_pb2 request_deserializers = { ('bftrader.bfkv.BfKvService', 'GetKv'): bftrader_pb2.BfKvData.FromString, ('bftrader.bfkv.BfKvService', 'Ping'): bftrader_pb2.BfPingData.FromString, ('bftrader.bfkv.BfKvService', 'SetKv'): bftrader_pb2.BfKvData.FromString, } response_serializers = { ('bftrader.bfkv.BfKvService', 'GetKv'): bftrader_pb2.BfKvData.SerializeToString, ('bftrader.bfkv.BfKvService', 'Ping'): bftrader_pb2.BfPingData.SerializeToString, ('bftrader.bfkv.BfKvService', 'SetKv'): bftrader_pb2.BfVoid.SerializeToString, } method_implementations = { ('bftrader.bfkv.BfKvService', 'GetKv'): face_utilities.unary_unary_inline(servicer.GetKv), ('bftrader.bfkv.BfKvService', 'Ping'): face_utilities.unary_unary_inline(servicer.Ping), ('bftrader.bfkv.BfKvService', 'SetKv'): face_utilities.unary_unary_inline(servicer.SetKv), } 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)