Namespace faabric::executor
-
namespace executor
-
Variables
-
static thread_local std::shared_ptr<ExecutorContext> context = nullptr
-
static std::shared_ptr<ExecutorFactory> _factory
-
class ChainedCallException : public faabric::util::FaabricException
Public Functions
-
inline explicit ChainedCallException(std::string message)
-
inline explicit ChainedCallException(std::string message)
-
class Executor
Public Functions
-
explicit Executor(faabric::Message &msg)
-
virtual ~Executor()
-
virtual void shutdown()
Shuts down the executor and clears all its state, including its thread pool.
This must be called before destructing an executor. This is because the tidy-up requires implementations of virtual methods held in subclasses, that may depend on state that those subclass instances hold. Because destructors run in inheritance order, this means that state may have been destructed before the executor destructor runs.
-
virtual void reset(faabric::Message &msg)
-
bool tryClaim()
-
void claim()
-
void releaseClaim()
-
std::shared_ptr<faabric::util::SnapshotData> getMainThreadSnapshot(faabric::Message &msg, bool createIfNotExists = false)
-
long getMillisSinceLastExec()
-
virtual std::span<uint8_t> getMemoryView()
-
virtual void restore(const std::string &snapshotKey)
-
faabric::Message &getBoundMessage()
-
bool isExecuting()
-
inline bool isShutdown()
-
void addChainedMessage(const faabric::Message &msg)
-
const faabric::Message &getChainedMessage(int messageId)
-
std::set<unsigned int> getChainedMessageIds()
-
std::vector<faabric::util::SnapshotDiff> mergeDirtyRegions(const Message &msg, const std::vector<char> &extraDirtyPages = {})
-
void setThreadResult(faabric::Message &msg, int32_t returnValue, const std::string &key, const std::vector<faabric::util::SnapshotDiff> &diffs)
-
virtual void setMemorySize(size_t newSize)
Public Members
-
std::string id
-
explicit Executor(faabric::Message &msg)
-
class ExecutorContext
- #include <ExecutorContext.h>
Globally-accessible wrapper that allows executing applications to query their execution context. The context is thread-local, so applications can query which specific message they are executing.
Public Functions
-
inline Executor *getExecutor()
-
inline std::shared_ptr<faabric::BatchExecuteRequest> getBatchRequest()
-
inline faabric::Message &getMsg()
-
inline int getMsgIdx()
Public Static Functions
-
static bool isSet()
-
static void unset()
-
static std::shared_ptr<ExecutorContext> get()
-
inline Executor *getExecutor()
-
class ExecutorContextException : public faabric::util::FaabricException
Public Functions
-
inline explicit ExecutorContextException(std::string message)
-
inline explicit ExecutorContextException(std::string message)
-
class ExecutorFactory
-
class ExecutorTask
Public Functions
-
ExecutorTask() = default
-
ExecutorTask(const ExecutorTask &other) = delete
-
ExecutorTask &operator=(const ExecutorTask &other) = delete
-
ExecutorTask(ExecutorTask &&other) = default
-
ExecutorTask &operator=(ExecutorTask &&other) = default
Public Members
-
std::shared_ptr<BatchExecuteRequest> req
-
int messageIndex = 0
-
ExecutorTask() = default
-
static thread_local std::shared_ptr<ExecutorContext> context = nullptr