GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 3.x: improve combineLatest method names · Issue #6634 · ReactiveX/RxJava

3.x: improve combineLatest method names #6634

New issue
Copy link
New issue
Copy link
Closed
Closed
3.x: improve combineLatest method names#6634
Copy link
Labels
3.xDiscussionEnhancement
Milestone
3.0

Description

@vanniktech
vanniktech
opened on Aug 27, 2019
Issue body actions

Calling combineLatest from Kotlin is a bit awkward. The function has a lot of different parameters, including Iterable, Array as well as 2-x call sites for passing multiple Observables.

Is it possible to prefix these so we have some kind of combineLatestFromIterable which takes the Iterable<T>:

-public static <T, R> Observable<R> combineLatest(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> combiner) {
+public static <T, R> Observable<R> combineLatestFromIterable(Iterable<? extends ObservableSource<? extends T>> sources, Function<? super Object[], ? extends R> combiner) {

and then combineLatest which takes the 2-x call sites.

public static <T1, T2, R> Observable<R> combineLatest(
            ObservableSource<? extends T1> source1, ObservableSource<? extends T2> source2,
            BiFunction<? super T1, ? super T2, ? extends R> combiner) {

The array call we could call combineLatestFromArray.

-public static <T, R> Observable<R> combineLatest(ObservableSource<? extends T>[] sources, Function<? super Object[], ? extends R> combiner) {
+public static <T, R> Observable<R> combineLatestFromArray(ObservableSource<? extends T>[] sources, Function<? super Object[], ? extends R> combiner) {

What should we do with?

public static <T, R> Observable<R> combineLatest(Function<? super Object[], ? extends R> combiner, int bufferSize, ObservableSource<? extends T>... sources) {

Is it really required? Callers could just use the array overload.

combineLatestDelayError is equivalent and could get the method name improvements as well.

Other methods, such as concat/merge could benefit from this change too.

Activity

  1. akarnokd commented on Aug 27, 2019

    @akarnokd
    akarnokd
    on Aug 27, 2019
    Member
    More actions

    combineLatestArray would be reasonable and match the other xArray method names. What's the conflict between combineLatest(Iterable, F) and combineLatest(O1, O2, F2)?

    The varargs variant could be removed.

  2. akarnokd
    added
    3.x
    Discussion
    Enhancement
    on Aug 27, 2019
  3. akarnokd
    added this to the 3.0 milestone on Aug 27, 2019
  4. vanniktech commented on Aug 27, 2019

    @vanniktech
    vanniktech
    on Aug 27, 2019
    CollaboratorAuthor
    More actions

    There should not be any issues with combineLatest(Iterable, F) and combineLatest(O1, O2, F2). I'd just go for consistency. Looking at startWithIterable.

  5. akarnokd commented on Aug 27, 2019

    @akarnokd
    akarnokd
    on Aug 27, 2019
    Member
    More actions

    startWithIterable was disambiguated due to startWith(Publisher) and/or startWith(T) so I'd say is an exception. So if the main trouble is with combineLatest(O[], F) then let's rename that to combineLatestArray.

    zip could use some name clarification too. There is zip(Iterable(P), F), zipIterable(Iterable(P), bool, int, F), zipArray(F, O...), zip(P(P)).

  6. vanniktech commented on Aug 28, 2019

    @vanniktech
    vanniktech
    on Aug 28, 2019
    CollaboratorAuthor
    More actions

    Closed by #6635 & #6640

  7. vanniktech
    closed this as completedon Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xDiscussionEnhancement

    Type

    No type

    Projects

    No projects

      Milestone

      • 3.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.