class documentation
class AddressChannel: (source)
Constructor: AddressChannel(channel, address, event_loop)
Simple container for a gRPC channel and its resolved address.
| Parameters | |
| channel | The underlying grpc.aio.Channel instance. |
| address | The resolved address string (for example 'host:port') that was used to create the channel. |
| event | Event loop that owns channel. This is optional for compatibility with callers constructing an AddressChannel directly. When omitted, ownership is inferred from the running or current loop. Callers wrapping a channel created elsewhere should pass its owner loop explicitly because this inference is only best effort. |
| Method | __init__ |
Initialize an AddressChannel instance. |
| Instance Variable | address |
Resolved address string used to create the channel. |
| Instance Variable | channel |
The underlying gRPC channel instance. |
| Instance Variable | event |
Event loop that owns the underlying gRPC channel. |
| Method | _ensure |
Initialize lifecycle state for legacy subclasses that skipped init. |
| Method | _is |
Return whether SDK lifecycle management closed this transport. |
| Method | _is |
Return whether SDK lifecycle management reserved this transport. |
| Method | _mark |
Record that SDK lifecycle management closed this transport. |
| Method | _new |
Create a fresh wrapper for another lease of this transport. |
| Method | _retire |
Atomically reserve this transport for SDK-managed closure. |
| Class Variable | _legacy |
Undocumented |
| Instance Variable | _close |
Undocumented |
| Instance Variable | _closed |
Undocumented |
| Instance Variable | _retired |
Undocumented |
def __init__(self, channel:
GRPCChannel, address: str, event_loop: AbstractEventLoop | None = None):
(source)
¶
Initialize an AddressChannel instance.
Create a fresh wrapper for another lease of this transport.
A fresh wrapper prevents an old holder from releasing a later lease. Custom wrappers can override this method when they must preserve additional wrapper state.
| Returns | |
AddressChannel | New wrapper for the same native channel and owner loop. |
Atomically reserve this transport for SDK-managed closure.
Retirement is permanent even when an owner loop stops before the native close can finish. A transport whose close was requested must never re-enter a pool while that close is pending or after its owner loop becomes available again.
| Returns | |
bool | True only for the caller that changed the transport from reusable to retired. Later close attempts return False. |