MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / allow_blocking_current_thread

Method allow_blocking_current_thread

crates/wasi/src/ctx.rs:162–165  ·  view source on GitHub ↗

Configures whether or not blocking operations made through this `WasiCtx` are allowed to block the current thread. WASI is currently implemented on top of the Rust [Tokio](https://tokio.rs/) library. While most WASI APIs are non-blocking some are instead blocking from the perspective of WebAssembly. For example opening a file is a blocking operation with respect to WebAssembly but it's implemente

(&mut self, enable: bool)

Source from the content-addressed store, hash-verified

160 /// a file). This can improve the performance of WASI operations when async
161 /// support is disabled.
162 pub fn allow_blocking_current_thread(&mut self, enable: bool) -> &mut Self {
163 self.filesystem.allow_blocking_current_thread = enable;
164 self
165 }
166
167 /// Appends multiple environment variables at once for this builder.
168 ///

Callers 3

configure_wasip2Method · 0.80
runFunction · 0.80
run_with_builderFunction · 0.80

Calls

no outgoing calls

Tested by 2

runFunction · 0.64
run_with_builderFunction · 0.64