-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Emit events when the connected state changes #64
Comments
Hi @xaviergonz , Can you please specify? So, do you want an event every time a user is connected to another user, or do you want a connected event when you are connected to the signaling server? Could you please name a good use-case for the connected event? The connected event is a farce. You never know when you are connected to all peers. So when exactly should the connected event be emitted? |
Sure. I mean an event that gets emitted when |
I just read the farce part, what does connected represent then? |
Makes sense. I will make a change so that a connected event is emitted. Sweet project, by the way! I'd love to receive a PR that adds A bit of background information:
It is true once the provider starts looking for other peers. Other peers can be found via signaling servers or via broadcastchannel (cross browser-tab communication). You never know when you are connected to all peers. You also don't know if there are other peers. In contrast to y-websocket, you can never know when you are connected to all sources that collaborate on the same room, as there is (by design) no central registry. |
Thanks for the info! (and the kudos!) I thought connected would give something more useful like if there's an active connection to the signaling server or similar rather than an intent to stay connected, so feel free to ignore the request then. About the PR, there's one already 😉 yjs/yjs#605 |
Feel free to use y-websocket & |
Is your feature request related to a problem? Please describe.
I'd like a 'connect' and 'close' events to be emitted after y-webrtc has connected/disconnected so that I can show a connection status badge without the need to poll every so often the 'connected' variable in the provider
The text was updated successfully, but these errors were encountered: