Fallback
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
provide.foundation.resilience.fallback
¶
Classes¶
FallbackChain
¶
Chain of fallback strategies for graceful degradation.
Executes fallback functions in order when primary function fails.
Functions¶
add_fallback
¶
Add a fallback function to the chain.
Source code in provide/foundation/resilience/fallback.py
execute
¶
Execute primary function with fallback chain (sync).
Source code in provide/foundation/resilience/fallback.py
execute_async
async
¶
Execute primary function with fallback chain (async).
Source code in provide/foundation/resilience/fallback.py
Functions¶
fallback
¶
Decorator to add fallback functions to a primary function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*fallback_funcs
|
Callable[..., T]
|
Functions to use as fallbacks, in order of preference |
()
|
Returns:
| Type | Description |
|---|---|
Callable
|
Decorated function that uses fallback chain |