Single provides a way to represent an Observable that will return just a single item (thus the name). You might ask, why it is worth having it at all? These types are useful to tell the developers about the specific behavior that they should expect.
To create a Single, one can use this example:
Single.just("One item")
The Single and the Subscription to it can be created with the following:
Single.just("One item")
.subscribe((item) -> {
log(item);
}, (throwable) -> {
log(throwable);
});
Note that this differs from Completable in that the first argument to the .subscribe() action now expects to receive an item as a result.