Re: [web-nfc] service workers, protocol handlers

Service Workers are event-based background workers, which means most 
of the time there shouldn't be any service workers running unless they
 are servicing a request (be it for a page/navigation, or other 
background tasks like incoming notifications for push messages).

That said, once spun up, service workers remain running for some time 
solely for optimization purposes (there are ongoing talks for how long
 they should be kept alive by default, though).

There are two ways to overcome this: one is to have the events baked 
in to the platform and make service workers capable of receiving 
incoming NFC data (that would need working with SW spec authors I 
guess).

The other method is to place NFC comms into their own Web Worker. 
There is ongoing discussion to make Service Workers to be able to have
 their own workers/workers shared with pages they control. In this 
scenario, the NFC comms would be running in a worker thread and only 
interacting with the page or service workers through this one 
indirection.

-- 
GitHub Notif of comment by flaki
See https://github.com/w3c/web-nfc/issues/17#issuecomment-96971579

Received on Tuesday, 28 April 2015 08:25:23 UTC