File ExecutorContext.h

namespace faabric
namespace executor
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

ExecutorContext(Executor *executorIn, std::shared_ptr<faabric::BatchExecuteRequest> reqIn, int msgIdx)
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 set(Executor *executorIn, std::shared_ptr<faabric::BatchExecuteRequest> reqIn, int msgIdxIn)
static void unset()
static std::shared_ptr<ExecutorContext> get()

Private Members

Executor *executor = nullptr
std::shared_ptr<faabric::BatchExecuteRequest> req = nullptr
int msgIdx = 0
class ExecutorContextException : public faabric::util::FaabricException

Public Functions

inline explicit ExecutorContextException(std::string message)