Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between doAfterSucces and doOnSuccess in Reactor?

Reactor has a number of these methods, doOnSuccessOrError and doAfterSuccessOrError for example.

What is the material difference? The documentation doesn't clarify.

like image 400
jimmy_terra Avatar asked Feb 05 '23 02:02

jimmy_terra


1 Answers

It is the matter of timing: "when the Mono terminates" and "after the Mono terminates". The doOnSuccessOrError notifies the handler before the downstream and the doAfterSuccessOrError notifies the handler after the downstream receives the respective terminal event.

like image 157
akarnokd Avatar answered Feb 06 '23 15:02

akarnokd