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

Method new

crates/wasi/src/p2/write_stream.rs:41–53  ·  view source on GitHub ↗
(write_budget: usize)

Source from the content-addressed store, hash-verified

39
40impl Worker {
41 fn new(write_budget: usize) -> Self {
42 Self {
43 state: Mutex::new(WorkerState {
44 alive: true,
45 items: std::collections::VecDeque::new(),
46 write_budget,
47 flush_pending: false,
48 error: None,
49 write_ready_changed: None,
50 }),
51 new_work: tokio::sync::Notify::new(),
52 }
53 }
54 fn check_write(&self) -> Result<usize, StreamError> {
55 let mut state = self.state();
56 if let Err(e) = state.check_error() {

Callers

nothing calls this directly

Calls 4

spawnFunction · 0.85
workMethod · 0.80
newFunction · 0.50
cloneFunction · 0.50

Tested by

no test coverage detected