W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2014

Re: Blocking message passing for Workers

From: Glenn Maynard <glenn@zewt.org>
Date: Fri, 8 Aug 2014 14:56:30 -0500
Message-ID: <CABirCh8_nn4jwWe_b1OVriF8-VAyM=kJq9_efZKXs-BmgsCh0A@mail.gmail.com>
To: adelespinasse@gmail.com
Cc: public-webapps WG <public-webapps@w3.org>
On Fri, Aug 8, 2014 at 12:49 PM, Alan deLespinasse <adelespinasse@gmail.com>
wrote:

> I would find it extremely useful to have a function available to a Worker
> that would block and wait for a message from another Worker or from the
> main thread. For example, instead of:
>
> onmessage = function(event) {
>   // Do some work
>   // Save all state for next time
> };
>
> I'd like to have something like this:
>
> while (true) {
>   var data = waitForMessage().data;
>   // Do some work
> }
>
> or:
>
> var subworker = new Worker('subworker.js');
> while (true) {
>   var data = subworker.waitForMessage().data;
>   // Do some work
> }
>

There have probably been other threads since, but here's a starting point:

http://lists.w3.org/Archives/Public/public-webapps/2010OctDec/1075.html

-- 
Glenn Maynard
Received on Friday, 8 August 2014 19:56:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:26 UTC