eclipse / microprofile-reactive-streams-operators

Microprofile project
Apache License 2.0
80 stars 33 forks source link

ReactiveStreamsFactory.fromSubscriber is defined as Subscriber<? extends T> #134

Closed akarnokd closed 4 years ago

akarnokd commented 4 years ago

When taking Subscriber as input, they are in a contravariant position, i.e., subscribe(Subscriber<? super T>) in Reactive Steams. However, one of Microprofile's method would require covariant subscriber:

ReactiveStreamsFactory.java#L139

This doesn't work because given a Publisher<Object>, subscribing with a Subscriber<String> will most likely lead to ClassCastExceptions.

cescoffier commented 4 years ago

Agreed!