Re: asynchronous vs synchronous instantiation of AudioWorkerNodes

On Fri, Nov 7, 2014 at 6:09 AM, Joseph Berkovitz <joe@noteflight.com> wrote:

> - Have createAudioWorker() return a Promise that yields a factory object
> with a method that synchronously creates nodes, with each node having its
> own AudioWorkerGlobalScope based on the already-loaded script.  Script
> *loading* would thus occur once per factory instance, but script
> *execution* would occur once per node instance. (this is my proposal,
> though I have little idea of what any implementation objections would be.)
>
> - Have createAudioWorker() return a Promise that yields a factory object
> containing a live AudioWorkerGlobalScope, and allow further nodes to be
> instantiated which share this same scope. Script loading and execution both
> occur once per factory, because the scope is shared. However this
> programming model does not isolate node instances’ state from each other.
> (This is my understanding of a proposal that Jussi made, I haven’t been
> able to track down the original. Jussi has said that some simple use of
> closures would make the state bookkeeping easy but I don’t think an example
> was provided.)
>

I prefer the latter, although the former works too. The ability to share
resources easily in the latter approach seems worth having.

Rob
-- 
oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo
owohooo
osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o
oioso
oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo
owohooo
osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro
ooofo
otohoeo ofoioroeo ooofo ohoeololo.

Received on Friday, 7 November 2014 00:42:38 UTC