Exemple #1
0
def beta_create_AtomicBroadcast_server(servicer,
                                       pool=None,
                                       pool_size=None,
                                       default_timeout=None,
                                       maximum_timeout=None):
    request_deserializers = {
        ('atomicbroadcast.AtomicBroadcast', 'Broadcast'):
        BroadcastMessage.FromString,
        ('atomicbroadcast.AtomicBroadcast', 'Deliver'):
        DeliverUpdate.FromString,
    }
    response_serializers = {
        ('atomicbroadcast.AtomicBroadcast', 'Broadcast'):
        BroadcastResponse.SerializeToString,
        ('atomicbroadcast.AtomicBroadcast', 'Deliver'):
        DeliverResponse.SerializeToString,
    }
    method_implementations = {
        ('atomicbroadcast.AtomicBroadcast', 'Broadcast'):
        face_utilities.stream_stream_inline(servicer.Broadcast),
        ('atomicbroadcast.AtomicBroadcast', 'Deliver'):
        face_utilities.stream_stream_inline(servicer.Deliver),
    }
    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)
Exemple #2
0
    def beta_create_RouteDiscoveryService_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 = {
            ('envoy.api.v2.RouteDiscoveryService', 'DeltaRoutes'):
            envoy_dot_api_dot_v2_dot_discovery__pb2.DeltaDiscoveryRequest.
            FromString,
            ('envoy.api.v2.RouteDiscoveryService', 'FetchRoutes'):
            envoy_dot_api_dot_v2_dot_discovery__pb2.DiscoveryRequest.
            FromString,
            ('envoy.api.v2.RouteDiscoveryService', 'StreamRoutes'):
            envoy_dot_api_dot_v2_dot_discovery__pb2.DiscoveryRequest.
            FromString,
        }
        response_serializers = {
            ('envoy.api.v2.RouteDiscoveryService', 'DeltaRoutes'):
            envoy_dot_api_dot_v2_dot_discovery__pb2.DeltaDiscoveryResponse.
            SerializeToString,
            ('envoy.api.v2.RouteDiscoveryService', 'FetchRoutes'):
            envoy_dot_api_dot_v2_dot_discovery__pb2.DiscoveryResponse.
            SerializeToString,
            ('envoy.api.v2.RouteDiscoveryService', 'StreamRoutes'):
            envoy_dot_api_dot_v2_dot_discovery__pb2.DiscoveryResponse.
            SerializeToString,
        }
        method_implementations = {
            ('envoy.api.v2.RouteDiscoveryService', 'DeltaRoutes'):
            face_utilities.stream_stream_inline(servicer.DeltaRoutes),
            ('envoy.api.v2.RouteDiscoveryService', 'FetchRoutes'):
            face_utilities.unary_unary_inline(servicer.FetchRoutes),
            ('envoy.api.v2.RouteDiscoveryService', 'StreamRoutes'):
            face_utilities.stream_stream_inline(servicer.StreamRoutes),
        }
        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)
Exemple #3
0
def beta_create_AtomicBroadcast_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  request_deserializers = {
    ('orderer.AtomicBroadcast', 'Broadcast'): common_dot_common__pb2.Envelope.FromString,
    ('orderer.AtomicBroadcast', 'Deliver'): SeekInfo.FromString,
  }
  response_serializers = {
    ('orderer.AtomicBroadcast', 'Broadcast'): BroadcastResponse.SerializeToString,
    ('orderer.AtomicBroadcast', 'Deliver'): DeliverResponse.SerializeToString,
  }
  method_implementations = {
    ('orderer.AtomicBroadcast', 'Broadcast'): face_utilities.stream_stream_inline(servicer.Broadcast),
    ('orderer.AtomicBroadcast', 'Deliver'): face_utilities.stream_stream_inline(servicer.Deliver),
  }
  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_Events_server(servicer,
                              pool=None,
                              pool_size=None,
                              default_timeout=None,
                              maximum_timeout=None):
    import events_pb2
    import events_pb2
    request_deserializers = {
        ('protos.Events', 'Chat'): events_pb2.Event.FromString,
    }
    response_serializers = {
        ('protos.Events', 'Chat'): events_pb2.Event.SerializeToString,
    }
    method_implementations = {
        ('protos.Events', 'Chat'):
        face_utilities.stream_stream_inline(servicer.Chat),
    }
    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()
    self._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),
    }

    self._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,
    }

    self._server_options = implementations.server_options(
        thread_pool_size=test_constants.POOL_SIZE)
    self._server_credentials = implementations.ssl_server_credentials(
        [(resources.private_key(), resources.certificate_chain(),),])
    self._client_credentials = implementations.ssl_client_credentials(
        resources.test_root_certificates(), None, None)
    self._stub_options = implementations.stub_options(
        thread_pool_size=test_constants.POOL_SIZE)
Exemple #6
0
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 _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)
Exemple #8
0
  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)
Exemple #9
0
    def beta_create_Events_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 = {
            ('hfc.protos.peer.Events', 'Chat'): Event.FromString,
        }
        response_serializers = {
            ('hfc.protos.peer.Events', 'Chat'): Event.SerializeToString,
        }
        method_implementations = {
            ('hfc.protos.peer.Events', 'Chat'):
            face_utilities.stream_stream_inline(servicer.Chat),
        }
        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)
Exemple #10
0
  def beta_create_Hello_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 = {
      ('grpcresolver.hello.Hello', 'Greeter'): HelloRequest.FromString,
      ('grpcresolver.hello.Hello', 'GreeterResponseStream'): HelloRequest.FromString,
      ('grpcresolver.hello.Hello', 'StreamGreeter'): HelloRequest.FromString,
      ('grpcresolver.hello.Hello', 'StreamGreeterResponseStream'): HelloRequest.FromString,
    }
    response_serializers = {
      ('grpcresolver.hello.Hello', 'Greeter'): HelloResponse.SerializeToString,
      ('grpcresolver.hello.Hello', 'GreeterResponseStream'): HelloResponse.SerializeToString,
      ('grpcresolver.hello.Hello', 'StreamGreeter'): HelloResponse.SerializeToString,
      ('grpcresolver.hello.Hello', 'StreamGreeterResponseStream'): HelloResponse.SerializeToString,
    }
    method_implementations = {
      ('grpcresolver.hello.Hello', 'Greeter'): face_utilities.unary_unary_inline(servicer.Greeter),
      ('grpcresolver.hello.Hello', 'GreeterResponseStream'): face_utilities.unary_stream_inline(servicer.GreeterResponseStream),
      ('grpcresolver.hello.Hello', 'StreamGreeter'): face_utilities.stream_unary_inline(servicer.StreamGreeter),
      ('grpcresolver.hello.Hello', 'StreamGreeterResponseStream'): face_utilities.stream_stream_inline(servicer.StreamGreeterResponseStream),
    }
    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)
Exemple #11
0
def beta_create_Listener_server(servicer,
                                pool=None,
                                pool_size=None,
                                default_timeout=None,
                                maximum_timeout=None):
    request_deserializers = {
        ('SpeechToText.Listener', 'DoConfig'): ConfigSTT.FromString,
        ('SpeechToText.Listener', 'DoSpeechToText'): SpeechChunk.FromString,
    }
    response_serializers = {
        ('SpeechToText.Listener', 'DoConfig'):
        ConfigResult.SerializeToString,
        ('SpeechToText.Listener', 'DoSpeechToText'):
        TranscriptChunk.SerializeToString,
    }
    method_implementations = {
        ('SpeechToText.Listener', 'DoConfig'):
        face_utilities.unary_unary_inline(servicer.DoConfig),
        ('SpeechToText.Listener', 'DoSpeechToText'):
        face_utilities.stream_stream_inline(servicer.DoSpeechToText),
    }
    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 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)
Exemple #14
0
    def setUp(self):
        self._servicer = _Servicer()
        self._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),
        }

        self._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,
        }

        self._server_options = implementations.server_options(
            thread_pool_size=test_constants.POOL_SIZE)
        self._server_credentials = implementations.ssl_server_credentials([
            (
                resources.private_key(),
                resources.certificate_chain(),
            ),
        ])
        self._channel_credentials = implementations.ssl_channel_credentials(
            resources.test_root_certificates())
        self._stub_options = implementations.stub_options(
            thread_pool_size=test_constants.POOL_SIZE)
Exemple #15
0
  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)
Exemple #16
0
  def beta_create_StockHQService_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 = {
      ('stock_hq.StockHQService', 'QA_fetch_p2p'): query_struct.FromString,
      ('stock_hq.StockHQService', 'QA_fetch_p2s'): query_struct.FromString,
      ('stock_hq.StockHQService', 'QA_fetch_s2p'): query_struct.FromString,
      ('stock_hq.StockHQService', 'QA_fetch_s2s'): query_struct.FromString,
    }
    response_serializers = {
      ('stock_hq.StockHQService', 'QA_fetch_p2p'): hq_struct.SerializeToString,
      ('stock_hq.StockHQService', 'QA_fetch_p2s'): hq_struct.SerializeToString,
      ('stock_hq.StockHQService', 'QA_fetch_s2p'): hq_struct.SerializeToString,
      ('stock_hq.StockHQService', 'QA_fetch_s2s'): hq_struct.SerializeToString,
    }
    method_implementations = {
      ('stock_hq.StockHQService', 'QA_fetch_p2p'): face_utilities.unary_unary_inline(servicer.QA_fetch_p2p),
      ('stock_hq.StockHQService', 'QA_fetch_p2s'): face_utilities.unary_stream_inline(servicer.QA_fetch_p2s),
      ('stock_hq.StockHQService', 'QA_fetch_s2p'): face_utilities.stream_unary_inline(servicer.QA_fetch_s2p),
      ('stock_hq.StockHQService', 'QA_fetch_s2s'): face_utilities.stream_stream_inline(servicer.QA_fetch_s2s),
    }
    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)
Exemple #17
0
    def beta_create_TestService_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 = {
            ('TestService', 'DelayedMethod'): StandardRequest.FromString,
            ('TestService', 'DelayedStream'): StreamRequest.FromString,
            ('TestService', 'ExceptionMethod'): StandardRequest.FromString,
            ('TestService', 'NormalMethod'): StandardRequest.FromString,
            ('TestService', 'StreamInputMethod'): StandardRequest.FromString,
            ('TestService', 'StreamMethod'): StreamRequest.FromString,
            ('TestService', 'StreamStreamMethod'): StandardRequest.FromString,
        }
        response_serializers = {
            ('TestService', 'DelayedMethod'): StandardReply.SerializeToString,
            ('TestService', 'DelayedStream'): StandardReply.SerializeToString,
            ('TestService', 'ExceptionMethod'):
            StandardReply.SerializeToString,
            ('TestService', 'NormalMethod'): StandardReply.SerializeToString,
            ('TestService', 'StreamInputMethod'):
            StreamReply.SerializeToString,
            ('TestService', 'StreamMethod'): StandardReply.SerializeToString,
            ('TestService', 'StreamStreamMethod'):
            StandardReply.SerializeToString,
        }
        method_implementations = {
            ('TestService', 'DelayedMethod'):
            face_utilities.unary_unary_inline(servicer.DelayedMethod),
            ('TestService', 'DelayedStream'):
            face_utilities.unary_stream_inline(servicer.DelayedStream),
            ('TestService', 'ExceptionMethod'):
            face_utilities.unary_unary_inline(servicer.ExceptionMethod),
            ('TestService', 'NormalMethod'):
            face_utilities.unary_unary_inline(servicer.NormalMethod),
            ('TestService', 'StreamInputMethod'):
            face_utilities.stream_unary_inline(servicer.StreamInputMethod),
            ('TestService', 'StreamMethod'):
            face_utilities.unary_stream_inline(servicer.StreamMethod),
            ('TestService', 'StreamStreamMethod'):
            face_utilities.stream_stream_inline(servicer.StreamStreamMethod),
        }
        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)
Exemple #18
0
  def beta_create_GNURadioLink_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 = {
      ('grgrpc.GNURadioLink', 'PublishData'): GRData.FromString,
      ('grgrpc.GNURadioLink', 'RequestData'): StatusData.FromString,
    }
    response_serializers = {
      ('grgrpc.GNURadioLink', 'PublishData'): StatusData.SerializeToString,
      ('grgrpc.GNURadioLink', 'RequestData'): GRData.SerializeToString,
    }
    method_implementations = {
      ('grgrpc.GNURadioLink', 'PublishData'): face_utilities.stream_stream_inline(servicer.PublishData),
      ('grgrpc.GNURadioLink', 'RequestData'): face_utilities.stream_stream_inline(servicer.RequestData),
    }
    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)
Exemple #19
0
  def beta_create_AtomicBroadcast_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 = {
      ('orderer.AtomicBroadcast', 'Broadcast'): hfc_dot_protos_dot_common_dot_common__pb2.Envelope.FromString,
      ('orderer.AtomicBroadcast', 'Deliver'): hfc_dot_protos_dot_common_dot_common__pb2.Envelope.FromString,
    }
    response_serializers = {
      ('orderer.AtomicBroadcast', 'Broadcast'): BroadcastResponse.SerializeToString,
      ('orderer.AtomicBroadcast', 'Deliver'): DeliverResponse.SerializeToString,
    }
    method_implementations = {
      ('orderer.AtomicBroadcast', 'Broadcast'): face_utilities.stream_stream_inline(servicer.Broadcast),
      ('orderer.AtomicBroadcast', 'Deliver'): face_utilities.stream_stream_inline(servicer.Deliver),
    }
    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)
Exemple #20
0
  def beta_create_AtomicBroadcast_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 = {
      ('orderer.AtomicBroadcast', 'Broadcast'): common_dot_common__pb2.Envelope.FromString,
      ('orderer.AtomicBroadcast', 'Deliver'): common_dot_common__pb2.Envelope.FromString,
    }
    response_serializers = {
      ('orderer.AtomicBroadcast', 'Broadcast'): BroadcastResponse.SerializeToString,
      ('orderer.AtomicBroadcast', 'Deliver'): DeliverResponse.SerializeToString,
    }
    method_implementations = {
      ('orderer.AtomicBroadcast', 'Broadcast'): face_utilities.stream_stream_inline(servicer.Broadcast),
      ('orderer.AtomicBroadcast', 'Deliver'): face_utilities.stream_stream_inline(servicer.Deliver),
    }
    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)
Exemple #21
0
def beta_create_ChaincodeSupport_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  request_deserializers = {
    ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.FromString,
  }
  response_serializers = {
    ('protos.ChaincodeSupport', 'Register'): ChaincodeMessage.SerializeToString,
  }
  method_implementations = {
    ('protos.ChaincodeSupport', 'Register'): face_utilities.stream_stream_inline(servicer.Register),
  }
  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_Connector_server(servicer,
                                     pool=None,
                                     pool_size=None,
                                     default_timeout=None,
                                     maximum_timeout=None):
        """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
        request_deserializers = {
            ('qlik.sse.Connector', 'EvaluateScript'): BundledRows.FromString,
            ('qlik.sse.Connector', 'ExecuteFunction'): BundledRows.FromString,
            ('qlik.sse.Connector', 'GetCapabilities'): Empty.FromString,
        }
        response_serializers = {
            ('qlik.sse.Connector', 'EvaluateScript'):
            BundledRows.SerializeToString,
            ('qlik.sse.Connector', 'ExecuteFunction'):
            BundledRows.SerializeToString,
            ('qlik.sse.Connector', 'GetCapabilities'):
            Capabilities.SerializeToString,
        }
        method_implementations = {
            ('qlik.sse.Connector', 'EvaluateScript'):
            face_utilities.stream_stream_inline(servicer.EvaluateScript),
            ('qlik.sse.Connector', 'ExecuteFunction'):
            face_utilities.stream_stream_inline(servicer.ExecuteFunction),
            ('qlik.sse.Connector', 'GetCapabilities'):
            face_utilities.unary_unary_inline(servicer.GetCapabilities),
        }
        server_options = beta_implementations.server_options(
            request_deserializers=request_deserializers,
            response_serializers=response_serializers,
            thread_pool=pool,
            thread_pool_size=pool_size,
            default_timeout=default_timeout,
            maximum_timeout=maximum_timeout)
        return beta_implementations.server(method_implementations,
                                           options=server_options)
Exemple #23
0
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)
Exemple #24
0
def beta_create_Events_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  import events_pb2
  import events_pb2
  request_deserializers = {
    ('protos.Events', 'Chat'): events_pb2.Event.FromString,
  }
  response_serializers = {
    ('protos.Events', 'Chat'): events_pb2.Event.SerializeToString,
  }
  method_implementations = {
    ('protos.Events', 'Chat'): face_utilities.stream_stream_inline(servicer.Chat),
  }
  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_Subscriber_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
    """The Beta API is deprecated for 0.15.0 and later.

    It is recommended to use the GA API (classes and functions in this
    file not marked beta) for all further purposes. This function was
    generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
    request_deserializers = {
      ('predix.eventhub.Subscriber', 'receive'): SubscriptionRequest.FromString,
      ('predix.eventhub.Subscriber', 'receiveWithAcks'): SubscriptionResponse.FromString,
      ('predix.eventhub.Subscriber', 'subscribe'): SubscriptionAcks.FromString,
    }
    response_serializers = {
      ('predix.eventhub.Subscriber', 'receive'): Message.SerializeToString,
      ('predix.eventhub.Subscriber', 'receiveWithAcks'): Message.SerializeToString,
      ('predix.eventhub.Subscriber', 'subscribe'): SubscriptionMessage.SerializeToString,
    }
    method_implementations = {
      ('predix.eventhub.Subscriber', 'receive'): face_utilities.unary_stream_inline(servicer.receive),
      ('predix.eventhub.Subscriber', 'receiveWithAcks'): face_utilities.stream_stream_inline(servicer.receiveWithAcks),
      ('predix.eventhub.Subscriber', 'subscribe'): face_utilities.stream_stream_inline(servicer.subscribe),
    }
    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)
Exemple #26
0
def beta_create_Engine_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.engine.Engine', 'CreateUniqueID'):
        dstore_dot_values__pb2.StringValue.FromString,
        ('dstore.engine.Engine', 'ExecBatch'):
        dstore_dot_engine_dot_procedure__pb2.Call.FromString,
        ('dstore.engine.Engine', 'ExecProcedure'):
        dstore_dot_engine_dot_procedure__pb2.Call.FromString,
        ('dstore.engine.Engine', 'IsValidUniqueID'):
        dstore_dot_values__pb2.StringValue.FromString,
    }
    response_serializers = {
        ('dstore.engine.Engine', 'CreateUniqueID'):
        dstore_dot_values__pb2.StringValue.SerializeToString,
        ('dstore.engine.Engine', 'ExecBatch'):
        dstore_dot_engine_dot_procedure__pb2.Response.SerializeToString,
        ('dstore.engine.Engine', 'ExecProcedure'):
        dstore_dot_engine_dot_procedure__pb2.Response.SerializeToString,
        ('dstore.engine.Engine', 'IsValidUniqueID'):
        dstore_dot_values__pb2.BooleanValue.SerializeToString,
    }
    method_implementations = {
        ('dstore.engine.Engine', 'CreateUniqueID'):
        face_utilities.unary_unary_inline(servicer.CreateUniqueID),
        ('dstore.engine.Engine', 'ExecBatch'):
        face_utilities.stream_stream_inline(servicer.ExecBatch),
        ('dstore.engine.Engine', 'ExecProcedure'):
        face_utilities.unary_stream_inline(servicer.ExecProcedure),
        ('dstore.engine.Engine', 'IsValidUniqueID'):
        face_utilities.unary_unary_inline(servicer.IsValidUniqueID),
    }
    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_TaskManager_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 = {
            ('gogrpcspec.TaskManager', 'AddTask'): Task.FromString,
            ('gogrpcspec.TaskManager', 'AddTasks'): Task.FromString,
            ('gogrpcspec.TaskManager', 'ChangeToDone'): Task.FromString,
            ('gogrpcspec.TaskManager', 'GetSummary'): Employee.FromString,
            ('gogrpcspec.TaskManager', 'GetTasks'): Employee.FromString,
        }
        response_serializers = {
            ('gogrpcspec.TaskManager', 'AddTask'):
            SpecificSummary.SerializeToString,
            ('gogrpcspec.TaskManager', 'AddTasks'): Summary.SerializeToString,
            ('gogrpcspec.TaskManager', 'ChangeToDone'): Task.SerializeToString,
            ('gogrpcspec.TaskManager', 'GetSummary'):
            SpecificSummary.SerializeToString,
            ('gogrpcspec.TaskManager', 'GetTasks'): Task.SerializeToString,
        }
        method_implementations = {
            ('gogrpcspec.TaskManager', 'AddTask'):
            face_utilities.unary_unary_inline(servicer.AddTask),
            ('gogrpcspec.TaskManager', 'AddTasks'):
            face_utilities.stream_unary_inline(servicer.AddTasks),
            ('gogrpcspec.TaskManager', 'ChangeToDone'):
            face_utilities.stream_stream_inline(servicer.ChangeToDone),
            ('gogrpcspec.TaskManager', 'GetSummary'):
            face_utilities.unary_unary_inline(servicer.GetSummary),
            ('gogrpcspec.TaskManager', 'GetTasks'):
            face_utilities.unary_stream_inline(servicer.GetTasks),
        }
        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)
Exemple #28
0
  def beta_create_Events_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.Events', 'Chat'): Event.FromString,
    }
    response_serializers = {
      ('protos.Events', 'Chat'): Event.SerializeToString,
    }
    method_implementations = {
      ('protos.Events', 'Chat'): face_utilities.stream_stream_inline(servicer.Chat),
    }
    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)
Exemple #29
0
    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_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)
Exemple #31
0
    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)
Exemple #32
0
    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_EntryDataService_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 = {
        ('etg.data.entry.EntryDataService', 'GetEntryStatus'):
        GetEntryStatusRequest.FromString,
        ('etg.data.entry.EntryDataService', 'GetYDTEntryDataAt'):
        GetYDTEntryDataRequest.FromString,
        ('etg.data.entry.EntryDataService', 'GetYDTEntryDataFrom'):
        GetYDTEntryDataRequest.FromString,
    }
    response_serializers = {
        ('etg.data.entry.EntryDataService', 'GetEntryStatus'):
        GetEntryStatusResponse.SerializeToString,
        ('etg.data.entry.EntryDataService', 'GetYDTEntryDataAt'):
        GetYDTEntryDataResponse.SerializeToString,
        ('etg.data.entry.EntryDataService', 'GetYDTEntryDataFrom'):
        GetYDTEntryDataResponse.SerializeToString,
    }
    method_implementations = {
        ('etg.data.entry.EntryDataService', 'GetEntryStatus'):
        face_utilities.stream_stream_inline(servicer.GetEntryStatus),
        ('etg.data.entry.EntryDataService', 'GetYDTEntryDataAt'):
        face_utilities.unary_unary_inline(servicer.GetYDTEntryDataAt),
        ('etg.data.entry.EntryDataService', 'GetYDTEntryDataFrom'):
        face_utilities.unary_stream_inline(servicer.GetYDTEntryDataFrom),
    }
    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)
Exemple #34
0
def beta_create_Peer_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  import fabric_pb2
  import fabric_pb2
  import fabric_pb2
  import fabric_pb2
  request_deserializers = {
    ('protos.Peer', 'Chat'): fabric_pb2.Message.FromString,
    ('protos.Peer', 'ProcessTransaction'): fabric_pb2.Transaction.FromString,
  }
  response_serializers = {
    ('protos.Peer', 'Chat'): fabric_pb2.Message.SerializeToString,
    ('protos.Peer', 'ProcessTransaction'): fabric_pb2.Response.SerializeToString,
  }
  method_implementations = {
    ('protos.Peer', 'Chat'): face_utilities.stream_stream_inline(servicer.Chat),
    ('protos.Peer', 'ProcessTransaction'): face_utilities.unary_unary_inline(servicer.ProcessTransaction),
  }
  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)
Exemple #36
0
  def beta_create_Remoting_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 = {
      ('remote.Remoting', 'Connect'): ConnectRequest.FromString,
      ('remote.Remoting', 'Receive'): MessageBatch.FromString,
    }
    response_serializers = {
      ('remote.Remoting', 'Connect'): ConnectResponse.SerializeToString,
      ('remote.Remoting', 'Receive'): Unit.SerializeToString,
    }
    method_implementations = {
      ('remote.Remoting', 'Connect'): face_utilities.unary_unary_inline(servicer.Connect),
      ('remote.Remoting', 'Receive'): face_utilities.stream_stream_inline(servicer.Receive),
    }
    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)
Exemple #37
0
  def beta_create_PublishBuildEvent_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.build.v1.PublishBuildEvent', 'PublishBuildToolEventStream'): OrderedBuildEvent.FromString,
      ('google.devtools.build.v1.PublishBuildEvent', 'PublishLifecycleEvent'): PublishLifecycleEventRequest.FromString,
    }
    response_serializers = {
      ('google.devtools.build.v1.PublishBuildEvent', 'PublishBuildToolEventStream'): PublishBuildToolEventStreamResponse.SerializeToString,
      ('google.devtools.build.v1.PublishBuildEvent', 'PublishLifecycleEvent'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
    }
    method_implementations = {
      ('google.devtools.build.v1.PublishBuildEvent', 'PublishBuildToolEventStream'): face_utilities.stream_stream_inline(servicer.PublishBuildToolEventStream),
      ('google.devtools.build.v1.PublishBuildEvent', 'PublishLifecycleEvent'): face_utilities.unary_unary_inline(servicer.PublishLifecycleEvent),
    }
    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_MovieService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  import movie_service_pb2
  import movie_service_pb2
  import google.protobuf.empty_pb2
  import movie_service_pb2
  import google.protobuf.empty_pb2
  import movie_service_pb2
  import movie_service_pb2
  import movie_service_pb2
  import movie_service_pb2
  import movie_service_pb2
  import movie_service_pb2
  import movie_service_pb2
  request_deserializers = {
    ('movieservice.MovieService', 'GetMovieDetails'): movie_service_pb2.MovieRequest.FromString,
    ('movieservice.MovieService', 'ListAllMovies'): google.protobuf.empty_pb2.Empty.FromString,
    ('movieservice.MovieService', 'ListAllMoviesServerStreaming'): google.protobuf.empty_pb2.Empty.FromString,
    ('movieservice.MovieService', 'ListMoviesBidirectionalStreaming'): movie_service_pb2.MovieRequest.FromString,
    ('movieservice.MovieService', 'ListMoviesClientToServerStreaming'): movie_service_pb2.MovieRequest.FromString,
    ('movieservice.MovieService', 'ListMoviesServerToClientStreaming'): movie_service_pb2.MoviesInTheaterRequest.FromString,
  }
  response_serializers = {
    ('movieservice.MovieService', 'GetMovieDetails'): movie_service_pb2.Movie.SerializeToString,
    ('movieservice.MovieService', 'ListAllMovies'): movie_service_pb2.MoviesInTheaterResponse.SerializeToString,
    ('movieservice.MovieService', 'ListAllMoviesServerStreaming'): movie_service_pb2.Movie.SerializeToString,
    ('movieservice.MovieService', 'ListMoviesBidirectionalStreaming'): movie_service_pb2.Movie.SerializeToString,
    ('movieservice.MovieService', 'ListMoviesClientToServerStreaming'): movie_service_pb2.MoviesInTheaterResponse.SerializeToString,
    ('movieservice.MovieService', 'ListMoviesServerToClientStreaming'): movie_service_pb2.Movie.SerializeToString,
  }
  method_implementations = {
    ('movieservice.MovieService', 'GetMovieDetails'): face_utilities.unary_unary_inline(servicer.GetMovieDetails),
    ('movieservice.MovieService', 'ListAllMovies'): face_utilities.unary_unary_inline(servicer.ListAllMovies),
    ('movieservice.MovieService', 'ListAllMoviesServerStreaming'): face_utilities.unary_stream_inline(servicer.ListAllMoviesServerStreaming),
    ('movieservice.MovieService', 'ListMoviesBidirectionalStreaming'): face_utilities.stream_stream_inline(servicer.ListMoviesBidirectionalStreaming),
    ('movieservice.MovieService', 'ListMoviesClientToServerStreaming'): face_utilities.stream_unary_inline(servicer.ListMoviesClientToServerStreaming),
    ('movieservice.MovieService', 'ListMoviesServerToClientStreaming'): face_utilities.unary_stream_inline(servicer.ListMoviesServerToClientStreaming),
  }
  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)
Exemple #39
0
def beta_create_Speech_server(servicer,
                              pool=None,
                              pool_size=None,
                              default_timeout=None,
                              maximum_timeout=None):
    import google.cloud.speech.v1.cloud_speech_pb2
    import google.cloud.speech.v1.cloud_speech_pb2
    import google.cloud.speech.v1.cloud_speech_pb2
    import google.cloud.speech.v1.cloud_speech_pb2
    request_deserializers = {
        ('google.cloud.speech.v1.Speech', 'NonStreamingRecognize'):
        google.cloud.speech.v1.cloud_speech_pb2.RecognizeRequest.FromString,
        ('google.cloud.speech.v1.Speech', 'Recognize'):
        google.cloud.speech.v1.cloud_speech_pb2.RecognizeRequest.FromString,
    }
    response_serializers = {
        ('google.cloud.speech.v1.Speech', 'NonStreamingRecognize'):
        google.cloud.speech.v1.cloud_speech_pb2.NonStreamingRecognizeResponse.
        SerializeToString,
        ('google.cloud.speech.v1.Speech', 'Recognize'):
        google.cloud.speech.v1.cloud_speech_pb2.RecognizeResponse.
        SerializeToString,
    }
    method_implementations = {
        ('google.cloud.speech.v1.Speech', 'NonStreamingRecognize'):
        face_utilities.unary_unary_inline(servicer.NonStreamingRecognize),
        ('google.cloud.speech.v1.Speech', 'Recognize'):
        face_utilities.stream_stream_inline(servicer.Recognize),
    }
    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)
Exemple #40
0
    def beta_create_HealthDiscoveryService_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 = {
            ('envoy.service.discovery.v2.HealthDiscoveryService', 'FetchHealthCheck'):
            HealthCheckRequestOrEndpointHealthResponse.FromString,
            ('envoy.service.discovery.v2.HealthDiscoveryService', 'StreamHealthCheck'):
            HealthCheckRequestOrEndpointHealthResponse.FromString,
        }
        response_serializers = {
            ('envoy.service.discovery.v2.HealthDiscoveryService', 'FetchHealthCheck'):
            HealthCheckSpecifier.SerializeToString,
            ('envoy.service.discovery.v2.HealthDiscoveryService', 'StreamHealthCheck'):
            HealthCheckSpecifier.SerializeToString,
        }
        method_implementations = {
            ('envoy.service.discovery.v2.HealthDiscoveryService', 'FetchHealthCheck'):
            face_utilities.unary_unary_inline(servicer.FetchHealthCheck),
            ('envoy.service.discovery.v2.HealthDiscoveryService', 'StreamHealthCheck'):
            face_utilities.stream_stream_inline(servicer.StreamHealthCheck),
        }
        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)
Exemple #41
0
def beta_create_gRIBI_server(servicer,
                             pool=None,
                             pool_size=None,
                             default_timeout=None,
                             maximum_timeout=None):
    request_deserializers = {
        ('gribi.gRIBI', 'Modify'): ModifyRequest.FromString,
    }
    response_serializers = {
        ('gribi.gRIBI', 'Modify'): ModifyResponse.SerializeToString,
    }
    method_implementations = {
        ('gribi.gRIBI', 'Modify'):
        face_utilities.stream_stream_inline(servicer.Modify),
    }
    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)
Exemple #42
0
def beta_create_OCPyNMS_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
  import pynms_rpc_pb2
  import pynms_rpc_pb2
  import pynms_rpc_pb2
  import pynms_rpc_pb2
  import pynms_rpc_pb2
  import pynms_rpc_pb2
  request_deserializers = {
    ('pynms_api.OCPyNMS', 'Get'): pynms_rpc_pb2.GetRequest.FromString,
    ('pynms_api.OCPyNMS', 'Set'): pynms_rpc_pb2.SetRequest.FromString,
    ('pynms_api.OCPyNMS', 'Subscribe'): pynms_rpc_pb2.SubscribeRequest.FromString,
  }
  response_serializers = {
    ('pynms_api.OCPyNMS', 'Get'): pynms_rpc_pb2.GetResponse.SerializeToString,
    ('pynms_api.OCPyNMS', 'Set'): pynms_rpc_pb2.SetResponse.SerializeToString,
    ('pynms_api.OCPyNMS', 'Subscribe'): pynms_rpc_pb2.SubscribeResponse.SerializeToString,
  }
  method_implementations = {
    ('pynms_api.OCPyNMS', 'Get'): face_utilities.unary_unary_inline(servicer.Get),
    ('pynms_api.OCPyNMS', 'Set'): face_utilities.unary_unary_inline(servicer.Set),
    ('pynms_api.OCPyNMS', 'Subscribe'): face_utilities.stream_stream_inline(servicer.Subscribe),
  }
  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):
    request_deserializers = {
        ('Greeter', 'SayHello'): HelloRequest.FromString,
        ('Greeter', 'SayHelloGoodbye'): HelloRequest.FromString,
        ('Greeter', 'SayHelloToMany'): HelloRequest.FromString,
        ('Greeter', 'SayHelloToManyAtOnce'): HelloRequest.FromString,
    }
    response_serializers = {
        ('Greeter', 'SayHello'): HelloReply.SerializeToString,
        ('Greeter', 'SayHelloGoodbye'): HelloReply.SerializeToString,
        ('Greeter', 'SayHelloToMany'): HelloReply.SerializeToString,
        ('Greeter', 'SayHelloToManyAtOnce'): HelloReply.SerializeToString,
    }
    method_implementations = {
        ('Greeter', 'SayHello'):
        face_utilities.unary_unary_inline(servicer.SayHello),
        ('Greeter', 'SayHelloGoodbye'):
        face_utilities.unary_stream_inline(servicer.SayHelloGoodbye),
        ('Greeter', 'SayHelloToMany'):
        face_utilities.stream_stream_inline(servicer.SayHelloToMany),
        ('Greeter', 'SayHelloToManyAtOnce'):
        face_utilities.stream_unary_inline(servicer.SayHelloToManyAtOnce),
    }
    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)