Giter Club home page Giter Club logo

Comments (4)

Kaiido avatar Kaiido commented on May 24, 2024 1

The Worker instance becomes a kind of proxy over the outside port MessagePort, so when that MessagePort would fire a messageerror event (i.e when the deserialization in the owner's side thrown), this event is expected to fire on the Worker instance.
However testing for this doesn't seem easy. The specs say that it may happen when a buffer can't be allocated, but I couldn't get one allocated in the worker thread that wouldn't be allocated in the owner's. It may also happen when posting an interface that doesn't exist on the receiving end, but once again I couldn't find a case where the serialization steps wouldn't throw before.

from html.

foolip avatar foolip commented on May 24, 2024

Thank you @Kaiido, it seems this even can be fired then, in principle. If an event propagates from a MessagePort to a Worker, where are the steps for this? In the message port post message steps only see MessagePort as the event target, so is there some general language about how events are propagated here?

from html.

annevk avatar annevk commented on May 24, 2024

It's hard to think of a case that would reliably fail as typically a dedicated worker is in the same agent cluster as its owner. And in the one case where that might not be the case (data: URLs and sandboxing) the dedicated worker is less privileged so you could not use SharedArrayBuffer as test. And beyond SharedArrayBuffer I'm not sure there's a good messageerror example, except for the theoretical one around OOO.

@foolip what you're looking for is described here: https://html.spec.whatwg.org/#dedicated-workers-and-the-worker-interface

All messages received by that port must immediately be retargeted at the Worker object.

from html.

foolip avatar foolip commented on May 24, 2024

I've filed https://crbug.com/335744333 about adding onmessageerror in Blink, if the event can fire at all, which I'm not sure about.

from html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.