class documentation

Channel that proxies requests to a single constant method.

Parameters
methodthe fully-qualified method name (service.method) to route to
sourcean existing ClientChannelInterface that performs authorization, pooling, and other channel operations
parent_idoptional parent id to override the source's parent id
Method __init__ Initialize the constant channel.
Method discard_channel Discard an address channel previously acquired from the source.
Method get_authorization_provider Return the authorization provider used by the underlying source channel.
Method get_channel_by_method Resolve an address channel by method name.
Method parent_id Return the effective parent id for this constant channel.
Method release_channel Release a channel through the source's non-masking lifecycle path.
Method return_channel Return a previously-acquired address channel to the source.
Method run_async Submit an awaitable to the source channel's SDK event loop.
Method run_sync Synchronously run an awaitable using the source channel's helper.
Method _has_authorization_provider Return whether the source has a fixed authorization provider.
Instance Variable _method Undocumented
Instance Variable _parent_id Undocumented
Instance Variable _source Undocumented
def __init__(self, method: str, source: ClientChannelInterface, parent_id: str | None = None): (source)

Initialize the constant channel.

def discard_channel(self, chan: AddressChannel | None): (source)

Discard an address channel previously acquired from the source.

This forwards to the wrapped source channel's discard_channel.

Parameters
chan:AddressChannel or Nonethe channel to discard
def get_authorization_provider(self) -> AuthorizationProvider | None: (source)

Return the authorization provider used by the underlying source channel.

Returns
AuthorizationProvider | NoneAuthorizationProvider or None
def get_channel_by_method(self, method_name: str) -> AddressChannel: (source)

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_name:strignored
Returns
AddressChannelan AddressChannel for the constant method
def parent_id(self) -> str | None: (source)

Return the effective parent id for this constant channel.

If a parent id was provided to the constructor it is returned; otherwise the source channel's parent id is used.

Returns
str | Nonethe parent id str or None
def release_channel(self, chan: AddressChannel | None, *, discard: bool = False): (source)

Release a channel through the source's non-masking lifecycle path.

def return_channel(self, chan: AddressChannel | None): (source)

Return a previously-acquired address channel to the source.

This forwards to the wrapped source channel's return_channel.

Parameters
chan:AddressChannel or Nonethe channel to return
def run_async(self, awaitable: Awaitable[T]) -> Awaitable[T]: (source)

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[T]Work to submit or return for legacy execution.
Returns
Awaitable[T]Source submission handle, or the unchanged awaitable.
def run_sync(self, awaitable: Awaitable[T], timeout: float | None = None) -> T: (source)

Synchronously run an awaitable using the source channel's helper.

Parameters
awaitable:Awaitable[T]an awaitable to execute
timeout:float or Noneoptional timeout forwarded to the source implementation
Returns
Tthe awaitable result
def _has_authorization_provider(self) -> bool | None: (source)

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 | NoneTrue or False when the source can answer safely, or None when provider discovery belongs to its owner loop.

Undocumented

_parent_id = (source)

Undocumented

Undocumented