Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Learning Progressive Web Apps: Service worker is like a Thread pool?

Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I haven't personally involved in developing PWA but heard lot about Service worker
The only way that i can relate this underlying mechanism is the Thread pool in java
is my understanding correct? please elaborate.

Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, Yes and No. With thread pools, you allocate threads your apps can use for, well anything. There are issues related to UI updates and other things threads have to worry about, but they're a way for apps to share the load as it were.

With Service Workers, your app can only have one - well, different parts of a web app can have their own (Chapter 3), but each page or set of pages can only have one. Service workers don't run all the time, so you can't rely upon them running when you want them to. Service workers expose a limited number of events it can respond to - the service worker sits dormant until one of these events fires, then goes back to sleep when it's done processing the event. Because of this, the scope of what you can do with service workers is limited.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic