Libspinscale: Initial top-level SMO port to coroutine framework
We haven't ported everything. Just the top-level methods. We'll dig in to the leaf stuff later. Surprisingly, this all went without any real difficulties. Runs like a charm on first try.
This commit is contained in:
@@ -4,9 +4,12 @@
|
||||
#include <boost/asio/signal_set.hpp>
|
||||
#include <cstdint>
|
||||
#include <atomic>
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <spinscale/component.h>
|
||||
#include <marionette/marionetteThread.h>
|
||||
|
||||
namespace sscl {
|
||||
|
||||
@@ -26,11 +29,17 @@ public:
|
||||
{}
|
||||
~MarionetteComponent() = default;
|
||||
|
||||
public:
|
||||
typedef std::function<void(bool)> mrnttLifetimeMgmtOpCbFn;
|
||||
void initializeReq(sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback);
|
||||
void finalizeReq(sscl::Callback<mrnttLifetimeMgmtOpCbFn> callback);
|
||||
// Intentionally doesn't take a callback.
|
||||
void holdInitializeCReq(std::function<void()> completion);
|
||||
void holdFinalizeCReq(std::function<void()> completion);
|
||||
|
||||
MrnttNonViralPostingInvoker initializeCReq(
|
||||
std::exception_ptr &exceptionPtr,
|
||||
std::function<void()> callback);
|
||||
|
||||
MrnttNonViralPostingInvoker finalizeCReq(
|
||||
std::exception_ptr &exceptionPtr,
|
||||
std::function<void()> callback);
|
||||
|
||||
void exceptionInd();
|
||||
|
||||
void handleLoopExceptionHook() override;
|
||||
@@ -47,11 +56,14 @@ protected:
|
||||
void handleTryBlock1UnknownException() override;
|
||||
|
||||
private:
|
||||
class MrnttLifetimeMgmtOp;
|
||||
class TerminationEvent;
|
||||
|
||||
std::unique_ptr<boost::asio::signal_set> signals;
|
||||
bool callShutdownSalmanoff = false;
|
||||
std::optional<MrnttNonViralPostingInvoker> initializeCReqInvoker;
|
||||
std::optional<MrnttNonViralPostingInvoker> finalizeCReqInvoker;
|
||||
|
||||
public:
|
||||
std::exception_ptr initializeLifetimeExceptionPtr;
|
||||
std::exception_ptr finalizeLifetimeExceptionPtr;
|
||||
};
|
||||
|
||||
extern std::shared_ptr<sscl::PuppeteerThread> thread;
|
||||
|
||||
Reference in New Issue
Block a user