File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 33
33
34
34
class YRoom :
35
35
clients : set [Websocket ]
36
+ fork_ydocs : set [Doc ]
36
37
ydoc : Doc
37
38
ystore : BaseYStore | None
38
39
ready_event : Event
@@ -83,6 +84,7 @@ def __init__(
83
84
self .ystore = ystore
84
85
self .log = log or getLogger (__name__ )
85
86
self .clients = set ()
87
+ self .fork_ydocs = set ()
86
88
self ._on_message = None
87
89
self .exception_handler = exception_handler
88
90
self ._stopped = Event ()
@@ -149,12 +151,15 @@ async def _broadcast_updates(self):
149
151
return
150
152
# broadcast internal ydoc's update to all clients, that includes changes from the
151
153
# clients and changes from the backend (out-of-band changes)
154
+ for ydoc in self .fork_ydocs :
155
+ ydoc .apply_update (update )
156
+
152
157
if self .clients :
153
158
message = create_update_message (update )
154
159
for client in self .clients :
155
160
try :
156
161
self .log .debug (
157
- "Sending Y update to client with endpoint: %s" , client .path
162
+ "Sending Y update to remote client with endpoint: %s" , client .path
158
163
)
159
164
self ._task_group .start_soon (client .send , message )
160
165
except Exception as exception :
You can’t perform that action at this time.
0 commit comments