56 std::optional<RunResult> run_result;
66 bool succeeded() const noexcept {
67 return status == InvocationStatus::Completed ||
68 status == InvocationStatus::Interrupted ||
69 status == InvocationStatus::MaxSteps ||
70 status == InvocationStatus::SafePoint;
72 bool cancelled() const noexcept {
return status == InvocationStatus::Cancelled; }
97 std::shared_ptr<CancelToken> cancel_token() const noexcept {
return token_; }
98 void cancel() noexcept { token_->cancel(); }
100 InvocationResult run();
101 asio::awaitable<InvocationResult> run_async();
103 InvocationResult resume(json resume_value = {});
104 asio::awaitable<InvocationResult> resume_async(json resume_value = {});
106 InvocationResult resume_from(std::string checkpoint_id,
107 json resume_value = {});
108 asio::awaitable<InvocationResult> resume_from_async(
109 std::string checkpoint_id, json resume_value = {});
112 GraphExecution execution_;
113 RunInvocationRequest request_;
114 std::shared_ptr<CancelToken> token_;
115 std::atomic_bool started_{
false};
117 void validate_request()
const;
118 bool try_start() noexcept;
119 InvocationResult failure(std::
string message) const;
120 static InvocationResult classify(RunResult result);
121 static InvocationResult classify_exception(std::exception_ptr error,