WIP: wrap async closures host-side
This commit is contained in:
parent
f110945fd6
commit
31e3a4d208
2 changed files with 173 additions and 2 deletions
|
@ -20,6 +20,12 @@ mod tests {
|
|||
imports: WasiFn<u32, u32>,
|
||||
}
|
||||
|
||||
async fn half(a: u32) -> u32 {
|
||||
a / 2
|
||||
}
|
||||
|
||||
let x = half;
|
||||
|
||||
async {
|
||||
let mut runtime = WasiPluginBuilder::new_with_default_ctx()
|
||||
.unwrap()
|
||||
|
@ -31,6 +37,8 @@ mod tests {
|
|||
.unwrap()
|
||||
.host_function("import_swap", |(a, b): (u32, u32)| (b, a))
|
||||
.unwrap()
|
||||
// .host_function_async("import_half", half)
|
||||
// .unwrap()
|
||||
.init(include_bytes!("../../../plugins/bin/test_plugin.wasm"))
|
||||
.await
|
||||
.unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue