You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RxJava has several hundred methods in Flowable and Observable each, many of them overloads of the same operator with different parameters because Java doesn't support default parameter values or that using methods with varargs is inconvenient at times.
To reduce the numbers, I suggest the following removals:
multi-source operators that take 7-9 sources, such as concat(p1, p2, p3, p4, p5, p6, p7, p8) and zip(p1, p2, p3, p4, p5, p6, p7, Function7)
operators that have multiple configuration options would only have 2 overloads, one with reasonable defaults and another with all parameters to be specified; example observeOn(Scheduler) and observeOn(Scheduler, delayError, prefetch), flatMap(mapper) and flatMap(mapper, maxConcurrency, delayError, prefetch)
For this latter, the documentation has to be enhanced to give examples of what defaults to use.
The text was updated successfully, but these errors were encountered:
I have another suggestion: source generate the missing overloads (using a Gradle plugin for example) so that we keep the class in the repository small but the actual included class has all available overloads.
This I feel is a good compromise between the Observable/Flowable classes being readable as well as giving the benefits of the extra overloads to the user.
I'm not sure management of the overloads has ever itself been a problem. If
they're going to end up in the jar anyway then it's not that big of a deal
to keep them in the source.
On Thu, Jun 30, 2016 at 2:00 PM Lalit Maganti [email protected]
wrote:
I have another suggestion: source generate the missing overloads (using a
Gradle plugin for example) so that we keep the class in the repository
small but the actual included class has all available overloads.
This I feel is a good compromise between the Observable/Flowable classes
being readable as well as giving the benefits of the extra overloads to the
user.
RxJava has several hundred methods in
Flowable
andObservable
each, many of them overloads of the same operator with different parameters because Java doesn't support default parameter values or that using methods with varargs is inconvenient at times.To reduce the numbers, I suggest the following removals:
concat(p1, p2, p3, p4, p5, p6, p7, p8)
andzip(p1, p2, p3, p4, p5, p6, p7, Function7)
observeOn(Scheduler)
andobserveOn(Scheduler, delayError, prefetch)
,flatMap(mapper)
andflatMap(mapper, maxConcurrency, delayError, prefetch)
For this latter, the documentation has to be enhanced to give examples of what defaults to use.
The text was updated successfully, but these errors were encountered: