The last on the list is the AsyncSubject. It works entirely differently from the previous Subjects because it only emits a single value that it has received from upstream Observables. What it does is that it waits for the upstream Observable to complete, and only then it will emit an item to its subscribers.
Again, let's look at an example:
Subject<String> subject = AsyncSubject.create();Observable.interval(0, 1, TimeUnit.SECONDS) .take(4) .map(Objects::toString) .subscribe(subject);subject.subscribe(v -> log(v));
Here, the upstream Observable is created by this:
Observable.interval(0, 1, TimeUnit.SECONDS) .take(4) .map(Objects::toString)
It will issue four items, and it will then complete. After this executes, we will see ...