简体   繁体   中英

Service Worker vs Web Worker

I wanna implement push notification for my website: Consider we have a shopping site, whenever a user click on one product, the server should push notification to the owner of the product that user (for example John) wants to buy your shoe. (real-time).

I have read some articles about web worker (like socket.io) and service workers, I conclude that service workers are the best choice. Am I true? How can I implement that push notification?

A Service Worker is a special kind of Web Workers. For implementing Web Push Notifications, it's a good choice to use Service Workers (does not work for Safari!). There is a great article explaining how to implement it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM