Ok so I am still trying to figure out what this paragraph entails:
> Invoking the wrapped Go function from JavaScript will pause the event loop and spawn a new goroutine. Other wrapped functions which are triggered during a call from Go to JavaScript get executed on the same goroutine.
> As a consequence, if one wrapped function blocks, JavaScript's event loop is blocked until that function returns. Hence, calling any async JavaScript API, which requires the event loop, like fetch (http.Client), will cause an immediate deadlock. Therefore > a blocking function should explicitly start a new goroutine.
As far as I understand, it means that only one wasm callback function can be run at a time and it will be run in a new goroutine. So there should be a happens-before edge here. Sequential ordering of synchronous callbacks should be kept. That does not require synchronization.
However, within that goroutine, other goroutines may be spawned. Naively, I would be tempted to say that it then may require synchronization.
But what makes me hesitate is that preempting the main goroutine and running a spawned goroutine that calls a wrapped function that requires the use of the event loop would block?
So how are goroutines scheduled here?
Can goroutines be interleaved? How does it not block then if several goroutines have to interact with the event loop?
Am I misunderstanding something?