wasmtime_store_epoch_deadline_callback function
- @Native<Void Function(Pointer<
wasmtime_store_t> , Pointer<NativeFunction< , Pointer<Pointer< >wasmtime_error_t> Function(Pointer<wasmtime_context_t> context, Pointer<Void> data, Pointer<Uint64> epoch_deadline_delta, Pointer<Uint8> update_kind)>Void> , Pointer<NativeFunction< )>(ffi.Pointer<wasmtime_store_t>, ffi.Pointer<ffi.NativeFunction<ffi.Pointer<wasmtime_error_t> Function(ffi.Pointer<wasmtime_context_t> context, ffi.Pointer<ffi.Void> data, ffi.Pointer<ffi.Uint64> epoch_deadline_delta, ffi.Pointer<wasmtime_update_deadline_kind_t> update_kind)>>, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>)>()Void Function(Pointer< >Void> )>
- Pointer<
wasmtime_store_t> store, - Pointer<
NativeFunction< func,Pointer< >wasmtime_error_t> Function(Pointer<wasmtime_context_t> context, Pointer<Void> data, Pointer<Uint64> epoch_deadline_delta, Pointer<Uint8> update_kind)> - Pointer<
Void> data, - Pointer<
NativeFunction< finalizer,Void Function(Pointer< >Void> )>
\brief Configures epoch deadline callback to C function.
This function configures a store-local callback function that will be called when the running WebAssembly function has exceeded its epoch deadline. That function can:
- return a #wasmtime_error_t to terminate the function
- set the delta argument and return NULL to update the epoch deadline delta and resume function execution.
- set the delta argument, update the epoch deadline, set update_kind to WASMTIME_UPDATE_DEADLINE_YIELD, and return NULL to yield (via async support) and resume function execution.
To use WASMTIME_UPDATE_DEADLINE_YIELD async support must be enabled for this store.
See also #wasmtime_config_epoch_interruption_set and #wasmtime_context_set_epoch_deadline.
Implementation
@ffi.Native<
ffi.Void Function(
ffi.Pointer<wasmtime_store_t>,
ffi.Pointer<
ffi.NativeFunction<
ffi.Pointer<wasmtime_error_t> Function(
ffi.Pointer<wasmtime_context_t> context,
ffi.Pointer<ffi.Void> data,
ffi.Pointer<ffi.Uint64> epoch_deadline_delta,
ffi.Pointer<wasmtime_update_deadline_kind_t> update_kind,
)
>
>,
ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>,
)
>()
external void wasmtime_store_epoch_deadline_callback(
ffi.Pointer<wasmtime_store_t> store,
ffi.Pointer<
ffi.NativeFunction<
ffi.Pointer<wasmtime_error_t> Function(
ffi.Pointer<wasmtime_context_t> context,
ffi.Pointer<ffi.Void> data,
ffi.Pointer<ffi.Uint64> epoch_deadline_delta,
ffi.Pointer<wasmtime_update_deadline_kind_t> update_kind,
)
>
>
func,
ffi.Pointer<ffi.Void> data,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
finalizer,
);