Comments (6)
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
from y-webrtc.
Feel free to use y-websocket & wss://demos.yjs.dev/ws
for demos. I recently added more resources, so it should work much better than before.
from y-webrtc.
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?
from y-webrtc.
Sure. I mean an event that gets emitted when connected
is changed. The he use case is for example a react component that renders the connection state and that calls setState when this event is emitted rather than needing to poll connected
within a setInterval
from y-webrtc.
I just read the farce part, what does connected represent then?
from y-webrtc.
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 mobx-keystone-yjs
to https://github.com/yjs/yjs/#bindings
A bit of background information:
provider.connected
was only added so it has a similar API to y-websocket
.
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. connected
doesn't mean that you are connected to any physical peers working on the same resource as you. It does not change unless you call provider.disconnect()
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.
from y-webrtc.
Related Issues (20)
- TypeError: Cannot read property 'encrypt' of undefined HOT 2
- Issues in trying to use `y-webrtc` : WebSocket is not defined : node_modules/lib0/websocket.js:25:23
- Over-strict type declaration for the options of WebRtcProvider
- Explore options for smaller footprint, browser-based webrtc clients HOT 6
- Library fails with missing global declarations when run inside nodejs (ES6) HOT 5
- Use Authentication for allowing/blocking access HOT 1
- Reactive "connected" property HOT 6
- Error when updating text field with long string HOT 1
- public signaling servers down? HOT 10
- add STUN/TURN servers after the provider is made HOT 6
- Error: A Yjs Doc connected to room "#room-name" already exists HOT 1
- Allow for or extend checking connectedness of the provider HOT 1
- y-webrtc doesn't work on different browsers HOT 3
- emit 'sync' HOT 1
- Use existing (3rd party) signaling server implementation HOT 1
- Problem with firefox and y-webrtc HOT 4
- Error message on Firefox: WebRTC: ICE failed, add a TURN server and see about:webrtc for more details HOT 1
- API modifications proposal
- The editor content does not sync on different browsers HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from y-webrtc.