Skip to content

2.x Flowable::amb(Iterable) and Observable::amb(Iterable) throw NP #4640

Closed
@VictorAlbertos

Description

@VictorAlbertos

I was working on #4633 and I found this behaviour, which is not consistent with the current implementation of Maybe::ambIterable, Single::ambIterable and Completable::ambIterable.

The next tests throws NP

@Test
public void Verify_Flowable_Amb_Iterable() throws InterruptedException {
  List<Flowable<String>> flowables = Arrays.asList(null, null, null);
  Flowable.amb(flowables).test();
}

@Test
public void Verify_Observable_Amb_Iterable() throws InterruptedException {
  List<Observable<String>> observables = Arrays.asList(null, null, null);
  Observable.amb(observables).test();
}

But for Maybe, Single and Completable the exception is catched and passed to the pipeline error.

Becase I'm using Flowable::amb(Iterable) and Observable::amb(Iterable) as a model to merge Maybe::ambIterable, Single::ambIterable and Completable::ambIterable into a single amb operator, I thought that Flowable::amb(Iterable) and Observable::amb(Iterable) should catch the error too. Doing something like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions