module documentation
Request helper used by generated clients.
This module implements Request which encapsulates a single RPC
invocation, including retries, authorization handling, metadata extraction
and convenience synchronous wrappers. The Request object is created by a
generated client and then awaited to perform the RPC. It is intentionally
rich: it exposes request status metadata (initial/trailing metadata,
request/trace ids), synchronous helpers (wait, initial_metadata_sync)
and configurable retry/timeout behaviour.
Key concepts:
- Authorization loop: when an authorization provider exists, the request will perform an auth step before attempting the RPC and will re-authenticate on UNAUTHENTICATED responses when allowed.
- Retry loop: transient errors are retried according to configured retry counts and per-retry timeouts.
Only small, non-behavioral changes should be made to this module because the Request logic is central to the SDK call semantics.
| Class | |
Encapsulates an RPC invocation with retries and auth handling. |
| Exception | |
Base exception for errors raised while processing a request. |
| Exception | |
Exception raised when a request is cancelled. |
| Exception | |
Exception raised when a request is already sent. |
| Exception | |
Exception raised when a request is sent without a call. |
| Constant | DEFAULT |
Default timeout including the authorization and the request itself. |
| Constant | DEFAULT |
Default per-retry timeout for requests. |
| Constant | DEFAULT |
Default timeout for requests not including authorization. |
| Type Variable | |
Error type variable. Either a protobuf/message or a custom wrapper. |
| Type Variable | |
Request type variable. Either a protobuf/message or a serializable payload. |
| Type Variable | |
Response type variable. Either a protobuf/message or a custom wrapper. |
| Type Variable | T |
Undocumented |
| Variable | log |
Undocumented |