EntropyEngine::Core::Concurrency::WorkResultContext
EntropyEngine::Core::Concurrency::WorkResultContext
Section titled “EntropyEngine::Core::Concurrency::WorkResultContext”Extended result context for yieldable work functions with timing support. More…
#include <WorkGraphTypes.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| WorkResultContext | yieldUntil(std::chrono::steady_clock::time_point when) Creates a timed yield result (reschedule at specific time). |
| WorkResultContext | yield() Creates an immediate yield result (reschedule ASAP). |
| WorkResultContext | complete() Creates a completion result. |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| std::optional< std::chrono::steady_clock::time_point > | wakeTime |
| WorkResult | result |
Detailed Description
Section titled “Detailed Description”struct EntropyEngine::Core::Concurrency::WorkResultContext;Extended result context for yieldable work functions with timing support.
Provides fine-grained control over when a yielded node should be rescheduled. Use the static factory methods for convenience.
// Immediate reschedule (old behavior)return WorkResultContext::yield();
// Timed reschedule (new - for timers, polling, etc.)auto wakeTime = std::chrono::steady_clock::now() + std::chrono::seconds(5);return WorkResultContext::yieldUntil(wakeTime);
// Completionreturn WorkResultContext::complete();Public Functions Documentation
Section titled “Public Functions Documentation”function yieldUntil
Section titled “function yieldUntil”static inline WorkResultContext yieldUntil( std::chrono::steady_clock::time_point when)Creates a timed yield result (reschedule at specific time).
Parameters:
- when The time point when the node should be rescheduled
Return: WorkResultContext configured for timed yield
Note: If the wake time is in the past or current time, the system treats it as an immediate yield (equivalent to calling yield()), rescheduling as soon as possible rather than failing or blocking.
Defers node execution until the specified wake time without consuming CPU resources. The node will be rescheduled for execution when the wake time is reached.
function yield
Section titled “function yield”static inline WorkResultContext yield()Creates an immediate yield result (reschedule ASAP).
function complete
Section titled “function complete”static inline WorkResultContext complete()Creates a completion result.
Public Attributes Documentation
Section titled “Public Attributes Documentation”variable wakeTime
Section titled “variable wakeTime”std::optional< std::chrono::steady_clock::time_point > wakeTime;variable result
Section titled “variable result”WorkResult result = WorkResult::Complete;Updated on 2026-01-26 at 17:14:35 -0500