feat(remoting): add observable members - #760
Open
Quenty wants to merge 2 commits into
Open
Conversation
Adds BindObservable on the server and Observe on the client, so a member can carry a live stream instead of a single value. The server factory runs once per subscription and the stream is torn down when the client unsubscribes, when the source ends, when the player leaves, or when the remoting is destroyed. Each observable member reserves one extra remote event, which carries subscribe and unsubscribe up and emissions down. Fixes two lifetime bugs found while building it. Remote instances are now parented only after their handler is attached, so a listener watching for one to appear can never catch it existing but not yet listening. PromiseFireServer, PromiseInvokeServer and PromiseInvokeClient now register their maid before attaching Finally; these promises settle synchronously once the remote exists, so the old order let Finally fire against nothing and stranded one maid entry per fire and per invoke for the lifetime of the remoting. Claude-Session: https://claude.ai/code/session_01BJmghas6c44BmqTJ39QPDD
A missing workspace symlink makes a service Init throw inside the loader. ServiceBag keeps going, so the bag comes up half-registered and a later GetService fails a binder, leaving one realm's tie with no implementation. It reads as a package bug and survives a clean checkout, because node_modules is untracked. Also notes that --script-text is truncated at the first newline on Windows while still reporting success. Claude-Session: https://claude.ai/code/session_01BJmghas6c44BmqTJ39QPDD
Test Results
21 tested, 21 passed, 0 failed in 57.2s · View logs Deploy Results
1 deployed, 1 passed, 0 failed in 2.7s · View logs |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remoting members can now carry an observable stream instead of a single value: the server binds a factory with BindObservable and the client subscribes with Observe, and the stream stays alive until the client unsubscribes, the source ends, the player leaves, or the remoting is destroyed. Each observable member reserves one extra remote event, which carries subscribe and unsubscribe up and emissions down.
This also fixes two lifetime bugs found while building it. Remote instances are now parented only after their handler is attached, so nothing watching for one to appear can catch it existing but not yet listening. The three promise methods now register their maid before attaching Finally, which stops them stranding one maid entry per fire and per invoke for the lifetime of the remoting.