mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
PuppetApp: Lifetime mgmt ops are now Viral
They no longer accept an exc_ptr and lambda for cb.
This commit is contained in:
@@ -2,8 +2,6 @@
|
|||||||
#define PUPPET_APPLICATION_H
|
#define PUPPET_APPLICATION_H
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <exception>
|
|
||||||
#include <functional>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -22,16 +20,11 @@ public:
|
|||||||
const std::vector<std::shared_ptr<PuppetThread>> &threads);
|
const std::vector<std::shared_ptr<PuppetThread>> &threads);
|
||||||
~PuppetApplication() = default;
|
~PuppetApplication() = default;
|
||||||
|
|
||||||
co::ViralNonPostingInvoker<void> joltAllPuppetThreadsCReq(
|
co::ViralNonPostingInvoker<void> joltAllPuppetThreadsCReq();
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback);
|
co::ViralNonPostingInvoker<void> startAllPuppetThreadsCReq();
|
||||||
co::ViralNonPostingInvoker<void> startAllPuppetThreadsCReq(
|
co::ViralNonPostingInvoker<void> pauseAllPuppetThreadsCReq();
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback);
|
co::ViralNonPostingInvoker<void> resumeAllPuppetThreadsCReq();
|
||||||
co::ViralNonPostingInvoker<void> pauseAllPuppetThreadsCReq(
|
co::ViralNonPostingInvoker<void> exitAllPuppetThreadsCReq();
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback);
|
|
||||||
co::ViralNonPostingInvoker<void> resumeAllPuppetThreadsCReq(
|
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback);
|
|
||||||
co::ViralNonPostingInvoker<void> exitAllPuppetThreadsCReq(
|
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback);
|
|
||||||
|
|
||||||
// CPU distribution method
|
// CPU distribution method
|
||||||
void distributeAndPinThreadsAcrossCpus();
|
void distributeAndPinThreadsAcrossCpus();
|
||||||
@@ -71,8 +64,6 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
co::ViralNonPostingInvoker<void> allPuppetThreadsLifetimeOpCReq(
|
co::ViralNonPostingInvoker<void> allPuppetThreadsLifetimeOpCReq(
|
||||||
std::exception_ptr &exceptionPtr,
|
|
||||||
std::function<void()> callback,
|
|
||||||
PuppetThread::ThreadOp threadOp,
|
PuppetThread::ThreadOp threadOp,
|
||||||
std::string_view emptyThreadsLogMessage);
|
std::string_view emptyThreadsLogMessage);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -63,9 +63,7 @@ void PuppetApplication::addAllPuppetLifetimeInvokersToGroup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
co::ViralNonPostingInvoker<void>
|
co::ViralNonPostingInvoker<void>
|
||||||
PuppetApplication::joltAllPuppetThreadsCReq(
|
PuppetApplication::joltAllPuppetThreadsCReq()
|
||||||
[[maybe_unused]] std::exception_ptr &exceptionPtr,
|
|
||||||
[[maybe_unused]] std::function<void()> callback)
|
|
||||||
{
|
{
|
||||||
if (threadsHaveBeenJolted)
|
if (threadsHaveBeenJolted)
|
||||||
{
|
{
|
||||||
@@ -94,8 +92,6 @@ PuppetApplication::joltAllPuppetThreadsCReq(
|
|||||||
|
|
||||||
co::ViralNonPostingInvoker<void>
|
co::ViralNonPostingInvoker<void>
|
||||||
PuppetApplication::allPuppetThreadsLifetimeOpCReq(
|
PuppetApplication::allPuppetThreadsLifetimeOpCReq(
|
||||||
[[maybe_unused]] std::exception_ptr &exceptionPtr,
|
|
||||||
[[maybe_unused]] std::function<void()> callback,
|
|
||||||
PuppetThread::ThreadOp threadOp,
|
PuppetThread::ThreadOp threadOp,
|
||||||
std::string_view emptyThreadsLogMessage)
|
std::string_view emptyThreadsLogMessage)
|
||||||
{
|
{
|
||||||
@@ -116,39 +112,31 @@ PuppetApplication::allPuppetThreadsLifetimeOpCReq(
|
|||||||
}
|
}
|
||||||
|
|
||||||
co::ViralNonPostingInvoker<void>
|
co::ViralNonPostingInvoker<void>
|
||||||
PuppetApplication::startAllPuppetThreadsCReq(
|
PuppetApplication::startAllPuppetThreadsCReq()
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback)
|
|
||||||
{
|
{
|
||||||
return allPuppetThreadsLifetimeOpCReq(
|
return allPuppetThreadsLifetimeOpCReq(
|
||||||
exceptionPtr, std::move(callback),
|
|
||||||
PuppetThread::ThreadOp::START,
|
PuppetThread::ThreadOp::START,
|
||||||
noPuppetThreadsToStartLogMessage);
|
noPuppetThreadsToStartLogMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
co::ViralNonPostingInvoker<void>
|
co::ViralNonPostingInvoker<void>
|
||||||
PuppetApplication::pauseAllPuppetThreadsCReq(
|
PuppetApplication::pauseAllPuppetThreadsCReq()
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback)
|
|
||||||
{
|
{
|
||||||
return allPuppetThreadsLifetimeOpCReq(
|
return allPuppetThreadsLifetimeOpCReq(
|
||||||
exceptionPtr, std::move(callback),
|
|
||||||
PuppetThread::ThreadOp::PAUSE,
|
PuppetThread::ThreadOp::PAUSE,
|
||||||
noPuppetThreadsToPauseLogMessage);
|
noPuppetThreadsToPauseLogMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
co::ViralNonPostingInvoker<void>
|
co::ViralNonPostingInvoker<void>
|
||||||
PuppetApplication::resumeAllPuppetThreadsCReq(
|
PuppetApplication::resumeAllPuppetThreadsCReq()
|
||||||
std::exception_ptr &exceptionPtr, std::function<void()> callback)
|
|
||||||
{
|
{
|
||||||
return allPuppetThreadsLifetimeOpCReq(
|
return allPuppetThreadsLifetimeOpCReq(
|
||||||
exceptionPtr, std::move(callback),
|
|
||||||
PuppetThread::ThreadOp::RESUME,
|
PuppetThread::ThreadOp::RESUME,
|
||||||
noPuppetThreadsToResumeLogMessage);
|
noPuppetThreadsToResumeLogMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
co::ViralNonPostingInvoker<void>
|
co::ViralNonPostingInvoker<void>
|
||||||
PuppetApplication::exitAllPuppetThreadsCReq(
|
PuppetApplication::exitAllPuppetThreadsCReq()
|
||||||
std::exception_ptr &exceptionPtr,
|
|
||||||
std::function<void()> callback)
|
|
||||||
{
|
{
|
||||||
if (componentThreads.empty())
|
if (componentThreads.empty())
|
||||||
{
|
{
|
||||||
@@ -157,7 +145,6 @@ PuppetApplication::exitAllPuppetThreadsCReq(
|
|||||||
}
|
}
|
||||||
|
|
||||||
co_await allPuppetThreadsLifetimeOpCReq(
|
co_await allPuppetThreadsLifetimeOpCReq(
|
||||||
exceptionPtr, std::move(callback),
|
|
||||||
PuppetThread::ThreadOp::EXIT,
|
PuppetThread::ThreadOp::EXIT,
|
||||||
noPuppetThreadsToExitLogMessage);
|
noPuppetThreadsToExitLogMessage);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user