class documentation
class Constant(ClientChannelInterface): (source)
Constructor: Constant(method, source, parent_id)
Channel that proxies requests to a single constant method.
| Parameters | |
| method | the fully-qualified method name (service.method) to route to |
| source | an existing ClientChannelInterface that performs
the actual channel operations (authorization, pooling, etc.) |
| parent | optional parent id to override the source's parent id |
| Method | __init__ |
Initialize the constant channel. |
| Method | discard |
Discard an address channel previously acquired from the source. |
| Method | get |
Return the authorization provider used by the underlying source channel (if any). |
| Method | get |
Resolve an address channel by method name. |
| Method | parent |
Return the effective parent id for this constant channel. |
| Method | return |
Return a previously-acquired address channel to the source. |
| Method | run |
Synchronously run an awaitable using the source channel's synchronization helper. |
| Instance Variable | _method |
Undocumented |
| Instance Variable | _parent |
Undocumented |
| Instance Variable | _source |
Undocumented |
def __init__(self, method:
str, source: ClientChannelInterface, parent_id: str | None = None):
(source)
¶
Initialize the constant channel.
Discard an address channel previously acquired from the source.
This forwards to the wrapped source channel's discard_channel.
| Parameters | |
chan:AddressChannel or None | the channel to discard |
Return the authorization provider used by the underlying source channel (if any).
| Returns | |
AuthorizationProvider | None | AuthorizationProvider or None |
Resolve an address channel by method name.
The provided method_name is ignored; this implementation always returns the address channel associated with the constant method provided at construction time.
| Parameters | |
| method | ignored |
| Returns | |
AddressChannel | an AddressChannel for the constant method |
Return a previously-acquired address channel to the source.
This forwards to the wrapped source channel's return_channel.
| Parameters | |
chan:AddressChannel or None | the channel to return |