Composeable macro Usage
Sync function
Async Function
The async function should return BoxFuture.
Retry in Fn Composer
Composeable macro supports retrying a function at specified interval in case of Error returned by the function. This could be useful when trying make a database call or connect to network endpoint. Make sure to install https://docs.rs/retry/latest/retry/ before proceeding with retry feature.
Retry mechanism is implemented as part of composeable procedureal macro. Below is example of add_10 function configured to be retried 2 times after initial failure.
use *;
Retry can be applied to both sync and async functions.
for async functions, all arguments to the function must be either shared reference or exclusive reference.
Below is example of async function with retry.
Apart from fixed duration retries, it is possible to configure with exponential delay. Refer to retry documentation for all available delay options https://docs.rs/retry/latest/retry/all.html