Repository navigation
feat: add replay subject - #50
Merged
Merged
Conversation
Adapt the replay subject proposed in #10 to the current actor-owned subject API. Preserve bounded FIFO replay and terminal notifications for late subscribers, and cover delivery without fixed sleeps. Original proposal: triandco/AsyncRx#10
Closed
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.
Adds
Reactive.replaySubject bufferSize, adapted from @triandco's proposal in #10 to the current Fable.Actor andReactiveAPIs.The subject retains up to
bufferSizerecent values. A new subscriber receives those values in FIFO order before live values; a subscriber arriving after termination also receives the completion or error. A single actor owns subscribers, the buffer, and terminal state, so replay cannot interleave with live publication. Non-positive buffer sizes are rejected, and disposal removes a live subscriber.The tests address the original review question: they wait for observer notifications with
TestObserver.WaitUntilinstead of fixed sleeps.OnNextAsyncacknowledges after the actor updates the retained buffer, so a subsequent subscription has a deterministic replay snapshot.Existing subject APIs and runtime behavior are unchanged. The implementation is covered on .NET, JavaScript, Python, and BEAM.