Unverified Commit b34f05ec authored by Anna Henningsen's avatar Anna Henningsen
Browse files

worker: prevent event loop starvation through MessagePorts

Limit the number of messages processed without interruption on a
given `MessagePort` to prevent event loop starvation, but still
make sure that all messages are emitted that were already in the
queue when emitting began.

This aligns the behaviour better with the web.

Refs: https://github.com/nodejs/node/pull/28030

PR-URL: https://github.com/nodejs/node/pull/29315


Reviewed-By: default avatarGus Caplan <me@gus.host>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
parent 82179902
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment