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
authorization, pooling, and other channel operations |
| 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. |
| Method | get |
Resolve an address channel by method name. |
| Method | parent |
Return the effective parent id for this constant channel. |
| Method | release |
Release a channel through the source's non-masking lifecycle path. |
| Method | return |
Return a previously-acquired address channel to the source. |
| Method | run |
Submit an awaitable to the source channel's SDK event loop. |
| Method | run |
Synchronously run an awaitable using the source channel's helper. |
| Method | _has |
Return whether the source has a fixed authorization provider. |
| Instance Variable | _method |
Undocumented |
| Instance Variable | _parent |
Undocumented |
| Instance Variable | _source |
Undocumented |
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.
| 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 |
Submit an awaitable to the source channel's SDK event loop.
A legacy source without run_async returns the original awaitable. Callers that retain the result must schedule a one-shot coroutine on their active loop before memoizing it.
| Parameters | |
awaitable:Awaitable[ | Work to submit or return for legacy execution. |
| Returns | |
Awaitable[ | Source submission handle, or the unchanged awaitable. |
Return whether the source has a fixed authorization provider.
Legacy sources do not expose the private caller-safe probe. Their auth timeout remains enforced by the request's authorization loop instead of by a speculative caller-side dispatch deadline.
| Returns | |
bool | None | True or False when the source can answer safely, or None when provider discovery belongs to its owner loop. |