-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Labels
Description
This sort of code is in a lot of places in the RxJava codebase:
new Subscriber<T>(s) {
@Override
public void onNext(T t) {
s.onNext(t);
}
@Override
public void onError(Throwable e) {
s.onError(e);
}
@Override
public void onCompleted() {
s.onCompleted();
}
}I'd like to add a utility method in Subscribers that does this. Any suggestions for a name to squeeze into the static namespace of this class? from would have been nice but is used by Subscribers.from(Observer) and this would be a breaking change if I added Subscribers.from(Subscriber) because they do different things and a Subscriber is an Observer.
Perhaps:
Subscribers.fromChained(Subscriber)Subscribers.passThrough(Subscriber)Subscribers.chained(Subscriber)
I'm sure someone will have a nicer suggestion than these.