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

Method inject_host_result

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

Inject `val` into the first `WaitingHostCall` waiter and mark it Ready; false if none. Uncorrelated path for hosts/tests that don't track call ids. */

(&mut self, val: Val)

Source from the content-addressed store, hash-verified

83
84 /* Inject `val` into the first `WaitingHostCall` waiter and mark it Ready; false if none. Uncorrelated path for hosts/tests that don't track call ids. */
85 pub fn inject_host_result(&mut self, val: Val) -> bool {
86 match self.scheduler.iter().position(|h| matches!(h.state, CoroState::WaitingHostCall(_))) {
87 Some(idx) => { self.deliver_host_result(idx, val); true }
88 None => false,
89 }
90 }
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 {

Callers 2

push_host_resultMethod · 0.80
set_host_resultFunction · 0.80

Calls 2

deliver_host_resultMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected