18#include <initializer_list>
120 return common::VoidResult(
result.error());
193 [[nodiscard]]
auto is_valid() const ->
bool;
Fluent builder for creating dag_job instances.
auto on_failure(std::function< common::VoidResult()> fallback) -> dag_job_builder &
Sets the fallback function for failure recovery.
auto reset() -> dag_job_builder &
Resets the builder to its initial state.
std::function< common::VoidResult()> fallback_func_
auto build() -> std::unique_ptr< dag_job >
Builds and returns the configured dag_job.
std::vector< job_id > dependencies_
auto is_valid() const -> bool
Validates the builder configuration.
auto get_validation_error() const -> std::optional< std::string >
Gets the validation error message.
auto returns() -> dag_job_builder &
Specifies the result type for the job.
std::function< common::VoidResult(dag_job &)> work_with_result_func_
dag_job_builder(dag_job_builder &&) noexcept=default
Move constructor.
auto work_with_result(std::function< common::Result< T >()> callable) -> dag_job_builder &
Sets the work function with result.
dag_job_builder(const std::string &name="dag_job")
Constructs a new builder with an optional job name.
std::function< common::VoidResult()> work_func_
auto work(std::function< common::VoidResult()> callable) -> dag_job_builder &
Sets the work function to execute.
auto depends_on(job_id dependency) -> dag_job_builder &
Adds a single dependency.
A job with dependency support for DAG-based scheduling.
Represents a unit of work (task) to be executed, typically by a job queue.
A template class representing either a value or an error.
T & value() &
Gets the value.
bool is_ok() const noexcept
Checks if the result is successful.
DAG-aware job with dependency tracking and unique identifiers.
Core threading foundation of the thread system library.
std::uint64_t job_id
Unique job identifier for DAG scheduler.
@ fallback
Execute fallback job if available.