YOrch 1.0.0
Loading...
Searching...
No Matches
concepts.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../detail/task_adapters/traits.hpp"
4#include "../slots.hpp"
5
6namespace yorch {
7
20template <typename Task, typename Ctx, typename Prev = no_prev>
22 requires(Task& task, exec_context<Ctx, Prev>& ec) {
23 task.invoke_raw(ec);
24 } &&
26
27template <typename Task, typename Ctx, typename Prev = no_prev>
30 requires(Task& task, exec_context<Ctx, Prev>& ec) {
31 {
32 task.invoke_into(
33 ec,
35 std::declval<detail::typed_slot<detail::declared_task_output_t<Task>>&>()})
36 } -> std::same_as<step_result>;
37 };
38
47template <typename Task, typename Ctx, typename Prev = no_prev>
51
61template <typename Task, typename Policy, typename Ctx, typename Prev = no_prev>
65
66template <typename Task, typename Policy, typename Ctx, typename Prev = no_prev>
69 std::is_nothrow_invocable_r_v<step_result, Policy&, const std::exception_ptr&>;
70
82template <typename Policy>
83concept retry_policy =
84 requires(const std::remove_cvref_t<Policy>& policy, std::size_t retry_count) {
85 { policy.should_retry(retry_count) } noexcept -> std::convertible_to<bool>;
86 };
87
88} // namespace yorch
Reports whether a task object exposes the raw execution protocol for a concrete exec_context.
Definition concepts.hpp:21
Reports whether catch_as_failure(task, policy) can wrap Task using the provided fallback Policy.
Definition concepts.hpp:62
Reports whether catch_as_failure(task) can wrap Task for a concrete execution context without a custo...
Definition concepts.hpp:48
Reports whether a retry policy exposes the minimal protocol required by with_retry(....
Definition concepts.hpp:83
constexpr bool is_adapter_descriptor_v
Definition adapters.hpp:63
constexpr auto task(F &&f)
Definition core.hpp:207