Service Worker vs Web Worker

戏子无情 提交于 2021-01-29 10:44:41

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/51920820/service-worker-vs-web-worker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!