Commit Graph

3 Commits

Author SHA1 Message Date
Anna Henningsen
d699fdd2c6
worker: mention argument name in type check message
Refs: https://github.com/nodejs/node/pull/32745#discussion_r406564208

PR-URL: https://github.com/nodejs/node/pull/32815
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
2020-04-15 16:36:27 +02:00
Anna Henningsen
a46345d8af
worker: fix type check in receiveMessageOnPort
Use the same type check we use in `MoveToContext()` in
`ReceiveMessage()`.

Fixes: https://github.com/nodejs/node/issues/32742

PR-URL: https://github.com/nodejs/node/pull/32745
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-04-13 15:07:52 +02:00
Anna Henningsen
76f2168393
worker: add ability to unshift message from MessagePort
In combination with Atomics, this makes it possible to implement
generic synchronous functionality, e.g. `importScript()`, in Workers
purely by communicating with other threads.

This is a continuation of https://github.com/nodejs/node/pull/26686,
where a preference for a solution was voiced that allowed reading
individual messages, rather than emitting all messages through events.

PR-URL: https://github.com/nodejs/node/pull/27294
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-05-19 22:01:34 +02:00