Pattern matching works now

This commit is contained in:
2025-11-27 22:47:02 +01:00
parent 4f989271c5
commit ecf151158d
22 changed files with 146 additions and 150 deletions

View File

@@ -241,11 +241,20 @@ pub fn extension_init(
})
.await,
api::HostExtReq::SysReq(api::SysReq::SysFwded(fwd)) => {
let fwd_tok = hand.will_handle_as(&fwd);
let api::SysFwded(sys_id, payload) = fwd;
let ctx = get_ctx(sys_id).await;
with_ctx(ctx.clone(), async move {
let sys = ctx.cted().inst();
sys.dyn_request(hand, payload).await
let reply = Rc::new(RefCell::new(None));
let reply2 = reply.clone();
let sub_hand = ExtReq::new(hand.reqnot(), async move |v| {
reply2.borrow_mut().replace(v);
});
sys.dyn_request(sub_hand, payload).await;
let reply_buf =
reply.borrow_mut().take().expect("Request discarded but did not throw");
hand.handle_as(fwd_tok, &reply_buf).await
})
.await
},