MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / deadlineWorkflow

Function deadlineWorkflow

Examples/AwaitDeadline/AwaitDeadline.cpp:22–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22static AwaitTask deadlineWorkflow(AwaitEventLoop& await, AwaitTimeoutResult& timeout)
23{
24 AwaitTask child = slowOperation(await);
25 SC_CO_TRY(await.spawn(child));
26
27 Result waitResult = co_await await.waitFor(child, {1}, &timeout);
28 if (waitResult or not timeout.timedOut or not child.isCompleted() or not AwaitIsCancelled(child.result()))
29 {
30 co_return Result::Error("AwaitDeadline expected timeout cancellation");
31 }
32
33 co_return Result(true);
34}
35
36static Result runAwaitDeadline()
37{

Callers 1

runAwaitDeadlineFunction · 0.85

Calls 8

slowOperationFunction · 0.85
AwaitIsCancelledFunction · 0.85
spawnMethod · 0.80
waitForMethod · 0.80
isCompletedMethod · 0.80
resultMethod · 0.80
ErrorEnum · 0.50
ResultClass · 0.50

Tested by

no test coverage detected