You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Programs like eBPF usually hire a callback function to let underlying framework to invoke it when a certain kind of event happened, to support this in WASM component model, it would be very useful to enable developers coding WASM component with callbacks.
Current WASM component model doesn't have an appropriate keyword/primitive to support that, and wasmtime doesn't support reentrance to WASM component.
The text was updated successfully, but these errors were encountered:
Sorry for the slow reply due to WasmCon, and thanks for filing.
I think you're right that we probably need a callback type in WIT. Another use case is discussed in #223. The main concern with callbacks is that, in cross-component/language scenarios, callbacks tend to immediately lead to cyclic leaks unless there is a global garbage/cycle-collector, which we don't have. However, near the end of #223 I was realizing that if we scope callbacks (to a call or a parent resource), then we can perhaps avoid the cycles by design. I haven't had time to focus on this recently, but after Preview 3 is finished, I am interested to focus on adding callbacks.
Separately, there is an Async.md#TODO to add a reentrant (or maybe recursive... exact name TBD) attribute on function types allowing them to opt into being called recursively. This is a simpler addition than the full callback type and so could be added sooner.
Programs like eBPF usually hire a callback function to let underlying framework to invoke it when a certain kind of event happened, to support this in WASM component model, it would be very useful to enable developers coding WASM component with callbacks.
Current WASM component model doesn't have an appropriate keyword/primitive to support that, and wasmtime doesn't support reentrance to WASM component.
The text was updated successfully, but these errors were encountered: