Re: Move sync APIs out of "Worker" into "SyncWorker"

On Tue, 29 Jul 2014, Jake Archibald wrote:
> On 29 July 2014 19:24, Ian Hickson <ian@hixie.ch> wrote:
> > On Tue, 29 Jul 2014, Jake Archibald wrote:
> > >
> > > Over in ServiceWorker we want to get all of the APIs available to 
> > > workers (FormData, indexeddb, URL etc), but not the synchronous 
> > > interfaces such as 
> > > http://dev.w3.org/2006/webapi/FileAPI/#readingOnThreads
> >
> > Why not the synchronous APIs?
> 
> ServiceWorker needs to be able to handle all of the fetches of a page 
> load, for instance. Sync APIs result in loading them in series. There's 
> never a good reason to be using a sync API in ServiceWorker.

Sure there is. If you know you're only going to get one request, and that 
request is for the data in the local database, then you just get the data 
and return it.

Are you also going to ban long-running scripts in service workers, the way 
we do for the main thread?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 29 July 2014 18:37:09 UTC