Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/test-programs/src/bin/async_yield_callee_synchronous.rs
1693 views
1
mod bindings {
2
wit_bindgen::generate!({
3
path: "../misc/component-async-tests/wit",
4
world: "yield-callee",
5
async: ["-local:local/run#[async]run"],
6
});
7
8
use super::Component;
9
export!(Component);
10
}
11
12
use bindings::{exports::local::local::run::Guest, local::local::continue_};
13
14
struct Component;
15
16
impl Guest for Component {
17
fn run() {
18
while continue_::get_continue() && wit_bindgen::yield_blocking() {}
19
}
20
}
21
22
// Unused function; required since this file is built as a `bin`:
23
fn main() {}
24
25