9 .ostream_func = [](std::ostream& os,
const UserType& user) -> std::ostream& {
10 os <<
"Future@" << user.data();
13 .deleter = [](
void* data) {
14 Future* f =
static_cast<Future*
>(data);
25 [vm, context, args]()
mutable {
Internal object to resolve asynchronously a function call in ArkScript.
The ArkScript virtual machine.
The ArkScript virtual machine, executing ArkScript bytecode.
void deleteContext(internal::ExecutionContext *ec)
Free a given execution context.
Value resolve(internal::ExecutionContext *context, const std::vector< Value > &n)
Resolves a function call (called by plugins and builtins)
void deleteFuture(internal::Future *f)
Free a given future.
std::future< Value > m_value
The actual thread.
VM * m_vm
Non-owning pointer.
static UserType::ControlFuncs ControlFunctions
Value resolve()
Await the future, blocking the thread it is run on.
Future(ExecutionContext *context, VM *vm, std::vector< Value > &args)
Create a Future and immediately start it through std::async.
const auto Nil
ArkScript Nil value.