Mono.delay(Duration.ofMillis(10)).map(d -> {
System.out.println(d);
return d;
}).block();
output : 0
Not able to see any output on console when I am calling with subscribe()
or subscribe(-)
methods instead of block()
Mono.delay(Duration.ofMillis(10)).map(d -> {
System.out.println(d);
return d;
}).subscribe(System.out::println);
Do we need to use only doOnSubscribe(-)
after this Mono.delay(-)
method?
Mono.delay(Duration.ofMillis(10)).doOnSubscribe(s -> {
System.out.println("its printing doOnSubscribe");
}).map(d -> {
System.out.println(d);
return d;
}).subscribe(System.out::println);
output it's printing doOnSubscribe