arrow-fx-coroutines / arrow.fx.coroutines / CircuitBreaker / doOnRejectedTask

doOnRejectedTask

fun doOnRejectedTask(callback: suspend () -> Unit): CircuitBreaker

Returns a new circuit breaker that wraps the state of the source and that upon a task being rejected will execute the given callback.

This 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.

Parameters

callback - will be executed when tasks get rejected.

Return a new circuit breaker wrapping the state of the source.

Do you like Arrow?

Arrow Org
<