On 2015/06/16 at 14:04:21, jochen wrote:
On 2015/06/16 at 14:03:36, jkummerow wrote:
> DBC:
>
> > var w = new Worker('path/to/script.js');
>
> This looks like it would require separate .js files, which would make it
hard to use this feature in mjsunit tests. (Yes we could support it, but we'd
have to add special-case hackery to blacklist those files from being treated
like standalone test cases.)
> How about passing a source string (representing the contents of the assumed
file) instead of a file name? Other than that, staying close to the Web API
sounds good.

I used a function instead, which I think is easier to read/write than a single string. One drawback is that it is perhaps less clear that the function does not inherit its lexical context like a function normally would. What do you think?

>
> > w.postMessage({thisParam: shouldBeTransferredAsJson}, [ab1, ab2]);
> > w.terminate();

fine by me

Still working on it, but patch 3 is closer to matching the Worker API. One thing
is sending messages back from the worker to the main thread. Since the main
thread isn't running an event loop, it will have to be a synchronous API. Maybe
just:

    w = new Worker(f);
    ...
    msg = w.getMessage();  // blocks
    w.terminate();

https://codereview.chromium.org/1185643004/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to