33#ifndef WASMTIME_ASYNC_H
34#define WASMTIME_ASYNC_H
44#ifdef WASMTIME_FEATURE_ASYNC
62WASMTIME_CONFIG_PROP(
void, async_support,
bool)
82WASMTIME_CONFIG_PROP(
void, async_stack_size, uint64_t)
135 void (*finalizer)(
void *);
305typedef uint8_t *(*wasmtime_stack_memory_get_callback_t)(
void *env,
320 void (*finalizer)(
void *);
349 void (*finalizer)(
void *);
wasmtime_error_t *(* wasmtime_new_stack_memory_callback_t)(void *env, size_t size, wasmtime_stack_memory_t *stack_ret)
Definition: async.h:334
wasmtime_call_future_t * wasmtime_func_call_async(wasmtime_context_t *context, const wasmtime_func_t *func, const wasmtime_val_t *args, size_t nargs, wasmtime_val_t *results, size_t nresults, wasm_trap_t **trap_ret, wasmtime_error_t **error_ret)
Invokes this function with the params given, returning the results asynchronously.
wasmtime_call_future_t * wasmtime_linker_instantiate_async(const wasmtime_linker_t *linker, wasmtime_context_t *store, const wasmtime_module_t *module, wasmtime_instance_t *instance, wasm_trap_t **trap_ret, wasmtime_error_t **error_ret)
Instantiates a wasm_module_t with the items defined in this linker for an async store.
struct wasmtime_async_continuation_t wasmtime_async_continuation_t
void(* wasmtime_func_async_callback_t)(void *env, wasmtime_caller_t *caller, const wasmtime_val_t *args, size_t nargs, wasmtime_val_t *results, size_t nresults, wasm_trap_t **trap_ret, wasmtime_async_continuation_t *continuation_ret)
Callback signature for wasmtime_linker_define_async_func.
Definition: async.h:164
struct wasmtime_call_future wasmtime_call_future_t
The structure representing a asynchronously running function.
Definition: async.h:178
wasmtime_error_t * wasmtime_linker_define_async_func(wasmtime_linker_t *linker, const char *module, size_t module_len, const char *name, size_t name_len, const wasm_functype_t *ty, wasmtime_func_async_callback_t cb, void *data, void(*finalizer)(void *))
Defines a new async function in this linker.
wasmtime_error_t * wasmtime_context_epoch_deadline_async_yield_and_update(wasmtime_context_t *context, uint64_t delta)
Configures epoch-deadline expiration to yield to the async caller and the update the deadline.
void wasmtime_config_host_stack_creator_set(wasm_config_t *, wasmtime_stack_creator_t *)
void wasmtime_call_future_delete(wasmtime_call_future_t *future)
bool(* wasmtime_func_async_continuation_callback_t)(void *env)
Definition: async.h:124
bool wasmtime_call_future_poll(wasmtime_call_future_t *future)
Executes WebAssembly in the function.
uint8_t *(* wasmtime_stack_memory_get_callback_t)(void *env, size_t *out_len)
Definition: async.h:305
wasmtime_error_t * wasmtime_context_fuel_async_yield_interval(wasmtime_context_t *context, uint64_t interval)
Configures a Store to yield execution of async WebAssembly code periodically.
wasmtime_call_future_t * wasmtime_instance_pre_instantiate_async(const wasmtime_instance_pre_t *instance_pre, wasmtime_context_t *store, wasmtime_instance_t *instance, wasm_trap_t **trap_ret, wasmtime_error_t **error_ret)
Instantiates instance within the given store.
Build-time defines for how the C API was built.
Wasmtime-specific extensions to wasm_config_t.
Definition and accessors of wasmtime_error_t.
struct wasmtime_instance_pre wasmtime_instance_pre_t
A wasmtime_instance_t, pre-instantiation, that is ready to be instantiated.
Definition: instance.h:121
Global engine configuration.
An opaque object representing the type of a function.
Opaque struct representing a wasm trap.
wasmtime_func_async_continuation_callback_t callback
Callback for if the async function has completed.
Definition: async.h:131
void * env
User-provided argument to pass to the callback.
Definition: async.h:133
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
Errors generated by Wasmtime.
Representation of a function in Wasmtime.
Definition: extern.h:25
Representation of a instance in Wasmtime.
Definition: instance.h:26
Object used to conveniently link together and instantiate wasm modules.
A compiled Wasmtime module.
wasmtime_new_stack_memory_callback_t new_stack
The callback to create a new stack, must be thread safe.
Definition: async.h:347
void * env
User provided value to be passed to new_stack.
Definition: async.h:345
wasmtime_stack_memory_get_callback_t get_stack_memory
Callback to get the memory and size of this LinearMemory.
Definition: async.h:318
void * env
User provided value to be passed to get_memory and grow_memory.
Definition: async.h:316
Container for different kinds of wasm values.
Definition: val.h:441