Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GateInterval not working after the first tick #1767

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

PathogenDavid
Copy link
Member

This was caused by a change from the Observable.Window(Func<IObservable<>> windowClosingSelector) overload to the Observable.Window(IObservable<> windowBoundaries) overload done in 606d6fe for #1315

These two overloads don't actually act quite the same way:

  • The former calls the function to retrieve an observable and subscribes to it every time a window opens. The window will close once it emits an element.
  • The latter subscribes once and the timing of elements emitted by the sequence determines when the window will close then re-open again.

The observable returned by Observable.Timer implicitly resets when it is re-subscribed, meaning it works fine with the former but only trigger once with the latter. (Essentially there was one window of the interval length followed by another which never closed.)

Observable.Interval on the other hand continuously emits new values on the interval, which means it works as expected with this overload and probably makes it better suited to this task regardless.

Fixes #1628

@glopesdev glopesdev added the fix Pull request that fixes an issue label Apr 30, 2024
@glopesdev glopesdev added this to the 2.8.3 milestone Apr 30, 2024
@glopesdev glopesdev merged commit eb3ef6f into bonsai-rx:main Apr 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull request that fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GateInterval terminates the subscription after the first period tick
2 participants