comlink icon indicating copy to clipboard operation
comlink copied to clipboard

Close or Terminate events on Comlink SharedWorker proxy for cleanup on Page or SharedWorker side

Open sivayapps opened this issue 4 years ago • 1 comments

When a page is closed or SharedWorker Terminated, there should be a way to notify SharedWorker for any required cleanup(in my case websocket STOMP subscriptions) When shared worker is terminated, there should be a way to reload shared worker, at least some guidance in documentation will be very helpful. I used heartbeat polling to achieve same(https://github.com/sivayapps/ws-lib), but it would be very helpful if documentation suggests any standard way of doing it with Comlink.

sivayapps avatar Jul 18 '21 08:07 sivayapps

This will be solved with the Comlink.finalizer method once I finally land #469

surma avatar Jul 19 '21 10:07 surma