Public Member Functions | |
def | __aenter__ (self) |
def | __aexit__ (self, exc_type, exc_val, exc_tb) |
def | __del__ (self) |
def | __init__ (self, str target, ChannelArgumentType options, Optional[grpc.ChannelCredentials] credentials, Optional[grpc.Compression] compression, Optional[Sequence[ClientInterceptor]] interceptors) |
None | channel_ready (self) |
def | close (self, Optional[float] grace=None) |
grpc.ChannelConnectivity | get_state (self, bool try_to_connect=False) |
StreamStreamMultiCallable | stream_stream (self, str method, Optional[SerializingFunction] request_serializer=None, Optional[DeserializingFunction] response_deserializer=None) |
StreamUnaryMultiCallable | stream_unary (self, str method, Optional[SerializingFunction] request_serializer=None, Optional[DeserializingFunction] response_deserializer=None) |
UnaryStreamMultiCallable | unary_stream (self, str method, Optional[SerializingFunction] request_serializer=None, Optional[DeserializingFunction] response_deserializer=None) |
UnaryUnaryMultiCallable | unary_unary (self, str method, Optional[SerializingFunction] request_serializer=None, Optional[DeserializingFunction] response_deserializer=None) |
None | wait_for_state_change (self, grpc.ChannelConnectivity last_observed_state) |
Private Member Functions | |
def | _close (self, grace) |
Private Attributes | |
_channel | |
_loop | |
_stream_stream_interceptors | |
_stream_unary_interceptors | |
_unary_stream_interceptors | |
_unary_unary_interceptors | |
Definition at line 244 of file grpc/aio/_channel.py.
def grpc.aio._channel.Channel.__init__ | ( | self, | |
str | target, | ||
ChannelArgumentType | options, | ||
Optional[grpc.ChannelCredentials] | credentials, | ||
Optional[grpc.Compression] | compression, | ||
Optional[Sequence[ClientInterceptor]] | interceptors | ||
) |
Constructor. Args: target: The target to which to connect. options: Configuration options for the channel. credentials: A cygrpc.ChannelCredentials or None. compression: An optional value indicating the compression method to be used over the lifetime of the channel. interceptors: An optional list of interceptors that would be used for intercepting any RPC executed with that channel.
Definition at line 252 of file grpc/aio/_channel.py.
def grpc.aio._channel.Channel.__del__ | ( | self | ) |
Definition at line 376 of file grpc/aio/_channel.py.
def grpc.aio._channel.Channel.__aenter__ | ( | self | ) |
Enables asynchronous RPC invocation as a client. Channel objects implement the Asynchronous Context Manager (aka. async with) type, although they are not supportted to be entered and exited multiple times.
Starts an asynchronous context manager. Returns: Channel the channel that was instantiated.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 296 of file grpc/aio/_channel.py.
def grpc.aio._channel.Channel.__aexit__ | ( | self, | |
exc_type, | |||
exc_val, | |||
exc_tb | |||
) |
Finishes the asynchronous context manager by closing the channel. Still active RPCs will be cancelled.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 299 of file grpc/aio/_channel.py.
|
private |
Definition at line 302 of file grpc/aio/_channel.py.
None grpc.aio._channel.Channel.channel_ready | ( | self | ) |
Creates a coroutine that blocks until the Channel is READY.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 393 of file grpc/aio/_channel.py.
def grpc.aio._channel.Channel.close | ( | self, | |
Optional[float] | grace = None |
||
) |
Closes this Channel and releases all resources held by it. This method immediately stops the channel from executing new RPCs in all cases. If a grace period is specified, this method wait until all active RPCs are finshed, once the grace period is reached the ones that haven't been terminated are cancelled. If a grace period is not specified (by passing None for grace), all existing RPCs are cancelled immediately. This method is idempotent.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 373 of file grpc/aio/_channel.py.
grpc.ChannelConnectivity grpc.aio._channel.Channel.get_state | ( | self, | |
bool | try_to_connect = False |
||
) |
Checks the connectivity state of a channel. This is an EXPERIMENTAL API. If the channel reaches a stable connectivity state, it is guaranteed that the return value of this function will eventually converge to that state. Args: try_to_connect: a bool indicate whether the Channel should try to connect to peer or not. Returns: A ChannelConnectivity object.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 381 of file grpc/aio/_channel.py.
StreamStreamMultiCallable grpc.aio._channel.Channel.stream_stream | ( | self, | |
str | method, | ||
Optional[SerializingFunction] | request_serializer = None , |
||
Optional[DeserializingFunction] | response_deserializer = None |
||
) |
Creates a StreamStreamMultiCallable for a stream-stream method. Args: method: The name of the RPC method. request_serializer: Optional :term:`serializer` for serializing the request message. Request goes unserialized in case None is passed. response_deserializer: Optional :term:`deserializer` for deserializing the response message. Response goes undeserialized in case None is passed. Returns: A StreamStreamMultiCallable value for the named stream-stream method.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 435 of file grpc/aio/_channel.py.
StreamUnaryMultiCallable grpc.aio._channel.Channel.stream_unary | ( | self, | |
str | method, | ||
Optional[SerializingFunction] | request_serializer = None , |
||
Optional[DeserializingFunction] | response_deserializer = None |
||
) |
Creates a StreamUnaryMultiCallable for a stream-unary method. Args: method: The name of the RPC method. request_serializer: Optional :term:`serializer` for serializing the request message. Request goes unserialized in case None is passed. response_deserializer: Optional :term:`deserializer` for deserializing the response message. Response goes undeserialized in case None is passed. Returns: A StreamUnaryMultiCallable value for the named stream-unary method.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 423 of file grpc/aio/_channel.py.
UnaryStreamMultiCallable grpc.aio._channel.Channel.unary_stream | ( | self, | |
str | method, | ||
Optional[SerializingFunction] | request_serializer = None , |
||
Optional[DeserializingFunction] | response_deserializer = None |
||
) |
Creates a UnaryStreamMultiCallable for a unary-stream method. Args: method: The name of the RPC method. request_serializer: Optional :term:`serializer` for serializing the request message. Request goes unserialized in case None is passed. response_deserializer: Optional :term:`deserializer` for deserializing the response message. Response goes undeserialized in case None is passed. Returns: A UnarySteramMultiCallable value for the named unary-stream method.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 411 of file grpc/aio/_channel.py.
UnaryUnaryMultiCallable grpc.aio._channel.Channel.unary_unary | ( | self, | |
str | method, | ||
Optional[SerializingFunction] | request_serializer = None , |
||
Optional[DeserializingFunction] | response_deserializer = None |
||
) |
Creates a UnaryUnaryMultiCallable for a unary-unary method. Args: method: The name of the RPC method. request_serializer: Optional :term:`serializer` for serializing the request message. Request goes unserialized in case None is passed. response_deserializer: Optional :term:`deserializer` for deserializing the response message. Response goes undeserialized in case None is passed. Returns: A UnaryUnaryMultiCallable value for the named unary-unary method.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 399 of file grpc/aio/_channel.py.
None grpc.aio._channel.Channel.wait_for_state_change | ( | self, | |
grpc.ChannelConnectivity | last_observed_state | ||
) |
Waits for a change in connectivity state. This is an EXPERIMENTAL API. The function blocks until there is a change in the channel connectivity state from the "last_observed_state". If the state is already different, this function will return immediately. There is an inherent race between the invocation of "Channel.wait_for_state_change" and "Channel.get_state". The state can change arbitrary many times during the race, so there is no way to observe every state transition. If there is a need to put a timeout for this function, please refer to "asyncio.wait_for". Args: last_observed_state: A grpc.ChannelConnectivity object representing the last known state.
Reimplemented from grpc.aio._base_channel.Channel.
Definition at line 386 of file grpc/aio/_channel.py.
|
private |
Definition at line 288 of file grpc/aio/_channel.py.
|
private |
Definition at line 287 of file grpc/aio/_channel.py.
|
private |
Definition at line 267 of file grpc/aio/_channel.py.
|
private |
Definition at line 266 of file grpc/aio/_channel.py.
|
private |
Definition at line 265 of file grpc/aio/_channel.py.
|
private |
Definition at line 264 of file grpc/aio/_channel.py.