|
| constexpr | retry_task (Task &&stored_task, Policy &&stored_policy) noexcept(std::is_nothrow_move_constructible_v< Task > &&std::is_nothrow_move_constructible_v< Policy >) |
| |
| constexpr | retry_task (const Task &stored_task, const Policy &stored_policy) noexcept(std::is_nothrow_copy_constructible_v< Task > &&std::is_nothrow_copy_constructible_v< Policy >) |
| |
template<typename Ctx , typename Prev >
requires adapter_wrappable_task<Task, Ctx, Prev> && retry_policy<Policy> |
| constexpr decltype(auto) | invoke_raw (exec_context< Ctx, Prev > &ec) noexcept(noexcept(task.invoke_raw(ec)) &&noexcept(policy.should_retry(std::size_t {})) &&noexcept(detail::handle_retry_exhausted(policy, std::declval< std::remove_cvref_t< detail::raw_task_result_t< Task &, Ctx, Prev > > >()))) |
| | Executes the wrapped task and re-runs it while policy permits.
|
| |
template<typename Ctx , typename Prev , typename U = Task>
requires direct_output_task<U, Ctx, Prev> && retry_policy<Policy> |
| constexpr step_result | invoke_into (exec_context< Ctx, Prev > &ec, direct_out< detail::declared_task_output_t< U > > out) noexcept(noexcept(task.invoke_into(ec, out)) &&noexcept(policy.should_retry(std::size_t {})) &&noexcept(detail::handle_retry_exhausted(policy, step_result::retry()))) |
| |
template<typename Task, typename Policy>
struct yorch::retry_task< Task, Policy >
Retry adapter that re-invokes a task when it returns retry.
This wrapper leaves the task's raw result type unchanged. Only results that can explicitly carry step_status::retry participate in the retry loop: step_result and task_result<T>. Plain value and void results are forwarded unchanged because they cannot request retry through the current status model.
- Template Parameters
-
| Task | Stored task type. |
| Policy | Stored retry policy type. |
Definition at line 68 of file retry.hpp.
template<typename Task , typename Policy >
template<typename Ctx , typename Prev >
requires adapter_wrappable_task<Task, Ctx, Prev> && retry_policy<Policy>
Executes the wrapped task and re-runs it while policy permits.
Each retry attempt re-enters the wrapped task from scratch with the same borrowed execution context. Side effects from earlier attempts are not rolled back by this adapter.
- Template Parameters
-
| Ctx | Context schema. |
| Prev | Direct-parent slot view type. |
- Parameters
-
| ec | Borrowed execution context. |
- Returns
- The first non-
retry raw result, or the policy-selected result once the retry budget is exhausted.
Definition at line 102 of file retry.hpp.