-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Client.Watch inside Client.Attach (#803)
In this commit, the existing Watch() function has been renamed to runWatchLoop(), similar to JS, and moved inside Attach(). runWatchLoop() creates a watch channel and inserts it into the client's attachment. Additionally, a Subscribe() function has been added, which simply retrieves the watch channel from the client's attachment corresponding to the document key and hands it over to the user. Throughout this process, we've ensured that users can disconnect the watch at any time via context and included logic to handle race conditions and various document states properly. Unfortunately, we haven't considered reconnection in case of watch connection failure. This is something that needs to be addressed. --------- Co-authored-by: karockai <karockai@gmail.com>
- Loading branch information
Showing
7 changed files
with
96 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.