Skip to content

JustMaier/pubsub-service-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PubSub in an service worker with IPFS

This was a quick exploration into using pubsub inside of a service worker using IPFS. Here's a video demo

Bad news

It doesn't work very well. Service workers aren't designed for short bursts of work like fetch and push. Since PubSub doesn't trigger either of those events, the service worker goes to sleep and the IPFS node dies.

Potential solutions

  • Use fetch for publishing to pubsub. Downside, it still doesn't keep the node alive to receive messages...
  • Use push to wake node and send pubsub messages. This would need to be built as an add-on for IPFS nodes so that peers could relay to sleeping service worker peers through nodes that have the push ability.

About

Trying to use pubsub inside an IPFS service worker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published