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
The entrypoint for a WebAssembly reactor module is _initialize instead of _start.
Assuming that the WebAssembly runtime is not reentrant (e.g. not threaded), then
this works if the //go:wasmexport calls are detected and wrapped in a function
that starts the Go scheduler.
When the exported function ends, all other goroutines are paused.
Goroutines started in a global init() function will run while the host has called into
the guest. They are paused when the guest call returns and restarted on the next call.
TODO: figure out how to enable reactor mode:
1. Should it be a flag to tinygo build?
2. Should it be a build tag (e.g. -tags reactor)?
3. Should the compiler detect the omission of main.main and automatically enable reactor mode?
TODO: figure out where best to wrap //go:wasmexport calls.
WIP
0 commit comments