Website | Source

Example:

Uni<String> request = makeSomeNetworkRequest(params);

request.ifNoItem().after(ofMillis(100))
    .failWith(() -> new TooSlowException("💥"))
    .onFailure(IOException.class).recoverWithItem(fail -> "📦")
    .subscribe().with(
        item -> log("👍 " + item),
         err -> log(err.getMessage())
    );


Tags: library   jvm   reactive  

Last modified 16 December 2024