//arrow-fx-coroutines/arrow.fx.coroutines/CircuitBreaker/doOnClosed

doOnClosed

common fun doOnClosed(callback: suspend () -> Unit): CircuitBreaker

Returns a new circuit breaker that wraps the state of the source and that will fire the given callback upon the circuit breaker transitioning to the CircuitBreaker.Closed state.

It is useful for gathering stats.

NOTE: calling this method multiple times will create a circuit breaker that will call multiple callbacks, thus the callback given is cumulative with other specified callbacks.

Return

a new circuit breaker wrapping the state of the source.

Parameters

common

   
callback will be executed when the state evolves into CircuitBreaker.Closed.

Do you like Arrow?

Arrow Org
<