View Source Virgil.Manager behaviour (Virgil v1.0.1)

Virgil Manager callbacks

Summary

Callbacks

Closes the circuit, it means the circuit will execute every time it is called

Increments the circuit error counter

Validates if the circuit is closed

Opens the circuit, it will not execute until the counter was completely cleaned up and the manager opens it again

Types

@type circuit_name() :: :atom

Callbacks

@callback close(circuit_name()) :: :ok | :error

Closes the circuit, it means the circuit will execute every time it is called

Link to this callback

increment_error_counter(circuit_name)

View Source
@callback increment_error_counter(circuit_name()) :: {:ok, integer()} | {:error, any()}

Increments the circuit error counter

Link to this callback

is_closed?(circuit_name)

View Source
@callback is_closed?(circuit_name()) :: {:ok, boolean()} | {:error, any()}

Validates if the circuit is closed

@callback open(circuit_name()) :: :ok | :error

Opens the circuit, it will not execute until the counter was completely cleaned up and the manager opens it again