The system responds in a timely manner if at all possible.
Responsiveness is the cornerstone of usability
The system stays responsive in the face of failure.
The system stays responsive under varying workload.
It can react to changes in the input rate by increasing or decreasing the resources allocated to service these inputs.
The system relies on asynchronous message passing to establish a boundary between components that ensures loose coupling, isolation, and location transparency.
Flow.Publisher<T>
@FunctionalInterface
public interface Publisher<T> {
void subscribe(Subscriber<? super T> s);
}
Use the subscribe method to register itself to Publisher
public interface Subscriber<T> {
void onSubscribe(Subscription s);
void onNext(T t);
void onError(Throwable t);
void onComplete();
}
onSubscribe onNext* (onError | onComplete)?
public interface Subscription {
void request(long n);
void cancel();
}
public interface Processor<T, R> extends Subscriber<T>, Publisher<R> { }
Observable
Observer
Operators
Streams
Schedulers
Subjects
A collection of callbacks that knows how to listen to values delivered by the Observable.
public interface Observer<T> {
void onSubscribe(Disposable d);
void onNext(T t);
void onError(Throwable t);
void onComplete();
}