MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / inject_host_result_by_id

Method inject_host_result_by_id

compiler/src/modules/vm/init.rs:93–98  ·  view source on GitHub ↗

Inject `val` into the `WaitingHostCall(id)` waiter and mark it Ready; false if no coro is parked on `id`. Lets the host resolve concurrent calls out of order. */

(&mut self, id: u64, val: Val)

Source from the content-addressed store, hash-verified

91
92 /* Inject `val` into the `WaitingHostCall(id)` waiter and mark it Ready; false if no coro is parked on `id`. Lets the host resolve concurrent calls out of order. */
93 pub fn inject_host_result_by_id(&mut self, id: u64, val: Val) -> bool {
94 match self.scheduler.iter().position(|h| matches!(h.state, CoroState::WaitingHostCall(w) if w == id)) {
95 Some(idx) => { self.deliver_host_result(idx, val); true }
96 None => false,
97 }
98 }
99
100 /* Shared tail: write `val` over the parked coro's saved-stack top and mark it Ready. */
101 fn deliver_host_result(&mut self, idx: usize, val: Val) {

Callers 2

set_host_result_by_idFunction · 0.80

Calls 2

deliver_host_resultMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected