Nursery: Initial integration
StimulusProducer: syncAwaitAllSettlements should pump caller io_context
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <spinscale/component.h>
|
||||
#include <spinscale/componentThread.h>
|
||||
#include <marionette/marionette.h>
|
||||
#include <spinscale/co/nonViralCompletion.h>
|
||||
#include <spinscale/runtime.h>
|
||||
#include <componentThread.h>
|
||||
#include <mindManager/mindManager.h>
|
||||
@@ -33,7 +34,12 @@ void marionetteInitializeReqCb(bool success)
|
||||
<< '\n';
|
||||
|
||||
mrntt.holdFinalizeCReq(
|
||||
[]() { marionetteFinalizeReqCb(true); });
|
||||
[](std::exception_ptr &exceptionPtr)
|
||||
{
|
||||
sscl::co::NonViralCompletion nvc(exceptionPtr);
|
||||
nvc.checkAndRethrowException();
|
||||
marionetteFinalizeReqCb(true);
|
||||
});
|
||||
}
|
||||
|
||||
void marionetteFinalizeReqCb(bool success)
|
||||
@@ -82,7 +88,12 @@ void MarionetteComponent::postJoltHook()
|
||||
break;
|
||||
}
|
||||
mrntt.holdFinalizeCReq(
|
||||
[]() { marionetteFinalizeReqCb(true); });
|
||||
[](std::exception_ptr &exceptionPtr)
|
||||
{
|
||||
sscl::co::NonViralCompletion nvc(exceptionPtr);
|
||||
nvc.checkAndRethrowException();
|
||||
marionetteFinalizeReqCb(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -128,14 +139,24 @@ void MarionetteComponent::preLoopHook()
|
||||
smo::initializeSalmanoff();
|
||||
callShutdownSalmanoff = true;
|
||||
|
||||
taskNursery.openAdmission();
|
||||
|
||||
holdInitializeCReq(
|
||||
[] { marionetteInitializeReqCb(true); });
|
||||
[](std::exception_ptr &exceptionPtr)
|
||||
{
|
||||
sscl::co::NonViralCompletion nvc(exceptionPtr);
|
||||
nvc.checkAndRethrowException();
|
||||
marionetteInitializeReqCb(true);
|
||||
});
|
||||
|
||||
std::cout << "PuppeteerThread::main: Entering event loop" << "\n";
|
||||
}
|
||||
|
||||
void MarionetteComponent::postLoopHook()
|
||||
{
|
||||
taskNursery.requestCancelOnAll();
|
||||
taskNursery.closeAdmission();
|
||||
|
||||
std::cout << "PuppeteerThread::main: Exited event loop" << "\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user