Single

The Single class works in a similar way to Mono from the Reactor library. This can also be used to perform a request to a server. We should consider using Flowable when a source returns only one item. 

The following example code shows how Single can be used:

Single.just(1).subscribe(Consumer<Int> { println(it) })

This snippet contains an instance of the Single class that emits one value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.96.105