WASM: defer next datagram read via setTimeout to yield to Go scheduler
This commit is contained in:
@@ -96,8 +96,8 @@ func (c *wtConn) startReader() {
|
||||
case c.incoming <- buf:
|
||||
default:
|
||||
}
|
||||
// Chain next read.
|
||||
readNext.Invoke()
|
||||
// Defer next read to next event loop tick so Go goroutines can process.
|
||||
js.Global().Call("setTimeout", readNext, 0)
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user