Beispiel #1
0
def generic_stub(channel, options=None):
  """Creates a face.GenericStub on which RPCs can be made.

  Args:
    channel: A Channel for use by the created stub.
    options: A StubOptions customizing the created stub.

  Returns:
    A face.GenericStub on which RPCs can be made.
  """
  effective_options = _EMPTY_STUB_OPTIONS if options is None else options
  return _client_adaptations.generic_stub(
      channel._channel,  # pylint: disable=protected-access
      effective_options.host, effective_options.metadata_transformer,
      effective_options.request_serializers,
      effective_options.response_deserializers)
Beispiel #2
0
def generic_stub(channel, options=None):
    """Creates a face.GenericStub on which RPCs can be made.

  Args:
    channel: A Channel for use by the created stub.
    options: A StubOptions customizing the created stub.

  Returns:
    A face.GenericStub on which RPCs can be made.
  """
    effective_options = _EMPTY_STUB_OPTIONS if options is None else options
    return _client_adaptations.generic_stub(
        channel._channel,  # pylint: disable=protected-access
        effective_options.host,
        effective_options.metadata_transformer,
        effective_options.request_serializers,
        effective_options.response_deserializers)