Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to use mqtt inside shared worker #168

Open
nosovk opened this issue Nov 11, 2020 · 1 comment
Open

allow to use mqtt inside shared worker #168

nosovk opened this issue Nov 11, 2020 · 1 comment

Comments

@nosovk
Copy link
Contributor

nosovk commented Nov 11, 2020

Currently Shared Worker allowed to create ws connection. Even more - it persists between page reloads, also it's shared between tabs. Looks great!
But there are few problems.

  1. to connect to shared worker we also have to use simplified messaging (which is ideal for MQTT)
  2. to run MQTT in shared worker we probably need lots of efforts from MQTT.js There is old abandoned version in official repo - https://github.com/mqttjs/mqtt-worker - currently it's not usable.

In my opinion the best solution is to setup internal mqtt between window and shared worker. And then shared worker could retranslate those messages to external broker.
Also in that way we can communicate between tabs using shared worker like small internal broker inside browser.

But main problem is running mqtt js in shared worker.

@nosovk
Copy link
Contributor Author

nosovk commented Nov 13, 2020

found https://github.com/cotonic/cotonic
It probably does what we need, but codestyle is bit weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant