cuda::experimental::stf::sump::retry_t#
-
struct retry_t#
The unit re-attempt: re-runs the callable once; if the re-run throws, passes that exception through.
Counts come from repetition,
retry * 3re-attempts up to three times andretry * 3 | subst(fallback)answers the spent failure, or from a count in one policy:retry(3), orretry(forever)until the action succeeds.retryalone isretry * 1.Answers
__fn()’s value for a non-void callable, orstd::ignoreafter a successful re-run of a void callable. A re-attempt chooses a value, so it cannot stand on the left of&:retry & subst(0)is rejected, andretry | subst(0)is the fallback after one re-run.On the code channel the re-run’s status decides: a success is handled, a failure passes through, carrying the latest status. A past result has no action to re-run, so
retryon a status operand is rejected at compile time.Public Functions
-
template<class _Fn>
inline decltype(auto) on_thrown( - const ::std::exception*,
- const ::cuda::std::source_location,
- _Fn &__fn
-
template<class _Status, class _Fn>
inline detail::__status_answer<_Status> on_returned(
) const# The code-channel hook: one re-run of a status-returning action.
-
inline detail::__retry_n_t operator()(const int __n) const#
Up to
__nre-attempts in one policy; exhaustion passes the last failure through.- Parameters:
__n – [in] The number of re-attempts, non-negative.
- Returns:
The counted re-attempt policy.
-
template<class _Fn>