Spring 5.0 Microservices(Second Edition)
上QQ阅读APP看书,第一时间看更新

Subscriber

Subscriber subscribes to a Publisher for consuming streams of data. It defines a set of callback methods, which will be called upon those events. Complete is when everything is done and success. Note, that all these are callback registrations, and the methods themselves do not respond with any data:

    public interface Subscriber<T> {
public void onSubscribe(Subscription s);
public void onNext(T t);
public void onError(Throwable t);
public void onComplete();
}