-
Notifications
You must be signed in to change notification settings - Fork 7.6k
GroupByUntil with maxGroups #665
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
Conversation
RxJava-pull-requests #600 FAILURE |
Why not remove the one that got a notification last? Not sure if this specific behavior particularly useful. |
I don't know. I think it matches Rx.NET's signature but I can't really look into |
public <TKey, TDuration> Observable<GroupedObservable<TKey, T>> groupByUntil( | ||
Func1<? super T, ? extends TKey> keySelector, | ||
Func1<? super GroupedObservable<TKey, T>, ? extends Observable<TDuration>> durationSelector, | ||
int maxGroups) { |
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.
This doesn't match the Rx.Net signature: http://msdn.microsoft.com/en-us/library/hh211932(v=vs.103).aspx
public static IObservable<IGroupedObservable<TKey, TSource>> GroupByUntil<TSource, TKey, TDuration>(
this IObservable<TSource> source,
Func<TSource, TKey> keySelector,
Func<IGroupedObservable<TKey, TSource>, IObservable<TDuration>> durationSelector
)
Why is maxGroups
being added to the signature?
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.
I saw this added in Rx 2.2.2: http://rx.codeplex.com/SourceControl/latest#Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable/GroupByUntil.cs
I thought it was about limiting the groups, but apparently the ConcurrentDictionary uses the capacity to specify the concurrency level, not the group number.
I guess this PR can be ignored.
@akarnokd Since we already have The stated reason is:
However, that is an arbitrary decision on how to "clear out the cache" and one that would need different eviction policies. If this is going to be pursued it needs something more thorough than just a As for Is it correct that you're trying to create a |
Closing based on discussion above ...
|
Split from #641
Purpose: limit the active groups to a certain number. If new group is opened, the oldest group is closed.