-
Notifications
You must be signed in to change notification settings - Fork 59
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
Added Observable.window(count, skip) operator #534
Conversation
Thanks for the PR, I will check when I have time. From the first sight, looks like you can avoid using the Serializer, since there is only one stream - the upstream. Serializer is needed when there are multiple concurrent data streams. The upstream is guaranteed to produce items sequentially. |
Oh, yes, i can avoid serializer, thanks. Then i need an atomic counter of active windows. I don't miss anything: upstream is guaranteed to produce items sequentially by library operators/factories, but we can create "unstable" upstream by Will update implementation today. |
Sequential streams are guaranteed by the Rx contract. Every stream is allowed to produce events on different threads but always sequentially. You can break the contract of course, but operators should not cover such cases. |
@arkivanov thanks for the clarification. Updated PR. |
…JS prohibits this
reaktive/src/commonMain/kotlin/com/badoo/reaktive/observable/WindowSized.kt
Outdated
Show resolved
Hide resolved
reaktive/src/commonMain/kotlin/com/badoo/reaktive/observable/WindowSized.kt
Outdated
Show resolved
Hide resolved
reaktive/src/commonMain/kotlin/com/badoo/reaktive/observable/WindowSized.kt
Outdated
Show resolved
Hide resolved
reaktive/src/commonMain/kotlin/com/badoo/reaktive/observable/WindowSized.kt
Outdated
Show resolved
Hide resolved
…r to incapsulate subscription logic, replaced unnessesary compareAndSet with !value
reaktive/src/commonMain/kotlin/com/badoo/reaktive/observable/WindowSized.kt
Outdated
Show resolved
Hide resolved
reaktive/src/commonMain/kotlin/com/badoo/reaktive/observable/WindowSized.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, let's use two counters. Otherwise looks good!
@amihusb Thanks for your contribution! |
As part of #411
Feels like i don't cover all cases in tests. Too complicated operator.
WindowSized
is the appropriate name?I'm embarrassed for the long wait, relocated to another city this month.