wasmtime_context_fuel_async_yield_interval function

  1. @Native<Pointer<wasmtime_error_t> Function(Pointer<wasmtime_context_t>, Uint64)>(ffi.Pointer<wasmtime_context_t>, ffi.Uint64)>()
Pointer<wasmtime_error_t> wasmtime_context_fuel_async_yield_interval(
  1. Pointer<wasmtime_context_t> context,
  2. int interval
)

\brief Configures a Store to yield execution of async WebAssembly code periodically.

When a Store is configured to consume fuel with wasmtime_config_consume_fuel this method will configure what happens when fuel runs out. Specifically executing WebAssembly will be suspended and control will be yielded back to the caller.

This is only suitable with use of a store associated with an async config because only then are futures used and yields are possible.

\param context the context for the store to configure. \param interval the amount of fuel at which to yield. A value of 0 will disable yielding.

Implementation

@ffi.Native<
  ffi.Pointer<wasmtime_error_t> Function(
    ffi.Pointer<wasmtime_context_t>,
    ffi.Uint64,
  )
>()
external ffi.Pointer<wasmtime_error_t>
wasmtime_context_fuel_async_yield_interval(
  ffi.Pointer<wasmtime_context_t> context,
  int interval,
);