pub fn task_with_retry<M, F>(
policy: RetryPolicy,
f: F,
on_exhaust: fn(String) -> M,
) -> Cmd<M>Expand description
Create a Cmd::Task that retries on failure with the given policy.
The f closure returns Result<M, String>. On Ok, the message is
returned immediately. On Err, the task retries according to the policy,
sleeping between attempts. After all retries are exhausted, on_exhaust
is called with the last error to produce a fallback message.