Taskolib
1.3.3
|
A context stores information that influences the execution of steps and sequences, namely:
The Context contains a message_callback_function that is called once for each message that is being processed by the execution engine in the main thread. By default, this function will send the output of the Lua "print()" command and error messages to stdout (see default_message_callback()). However, message_callback_function can also be set to nullptr (to disable any special behavior) or to a custom function:
The callback function receives a reference to the message that is being processed. If a sequence is executed in the current thread (e.g. via Sequence::execute()), the callback is executed whenever a message is generated. If the sequence is handed to an Executor for parallel execution, the callback is run whenever the main thread has received the message (i.e. typically within Executor::update()). Callbacks are never executed on the worker thread.
#include <Context.h>
Public Attributes | |
VariableTable | variables |
A map of variables (names and values) that can be im-/exported into steps. More... | |
std::string | step_setup_script = "" |
Step setup script with common functions or constants like a small library. More... | |
std::function< void(sol::state &)> | step_setup_function |
An initialization function that is called on a Lua state before a step is executed. More... | |
MessageCallback | message_callback_function = default_message_callback |
A callback (or "hook") function that is invoked whenever a message is processed during the execution of a sequence. More... | |
MessageCallback task::Context::message_callback_function = default_message_callback |
A callback (or "hook") function that is invoked whenever a message is processed during the execution of a sequence.
Referenced by task::Executor::launch_async_execution(), task::send_message(), and task::Executor::update().
std::function<void(sol::state&)> task::Context::step_setup_function |
An initialization function that is called on a Lua state before a step is executed.
Referenced by task::Step::execute_impl().
std::string task::Context::step_setup_script = "" |
Step setup script with common functions or constants like a small library.
Overwritten when a sequence is started.
Referenced by task::Step::execute_impl(), and task::Sequence::handle_execution().
VariableTable task::Context::variables |
A map of variables (names and values) that can be im-/exported into steps.
Referenced by task::Executor::cancel(), task::Step::copy_used_variables_from_context_to_lua(), task::Step::copy_used_variables_from_lua_to_context(), task::Executor::get_context_variables(), and task::Executor::is_busy().