fault_rate() = float()
fuse_context() = sync | async_dirty
fuse_options() = {fuse_strategy(), fuse_refresh()}
fuse_refresh() = {reset, pos_integer()}
fuse_strategy() = {standard, pos_integer(), pos_integer()} | {fault_injection, fault_rate(), pos_integer(), pos_integer()}
ask/2 | ask/1 queries the state of a fuse
Given ask(N) we ask the fuse state for the name N . |
circuit_disable/1 | circuit_disable/1 administratively disable a circuit. |
circuit_enable/1 | circuit_enable/1 administratively (re-)enables a fuse. |
install/2 | install/2 adds a new fuse to the running system. |
melt/1 | melt/1 melts a fuse a little bit
A call to melt(N) will melt fuse N . |
remove/1 | remove/1 removs a fuse
Given remove(N) this removes the fuse under the name N . |
reset/1 | reset/1 resets a fuse
Given reset(N) this resets the fuse under the name N . |
run/3 | run/2 runs a thunk under a given fuse
Calling run(Name, Func) will run Func protected by the fuse Name |
ask(Name, Context::fuse_context()) -> ok | blown | {error, not_found}
ask/1 queries the state of a fuse
Given ask(N)
we ask the fuse state for the name N
. Returns the fuse state, either ok
or blown
.
If there is no such fuse, returns {error, not_found}
circuit_disable(Name) -> ok
circuit_disable/1 administratively disable a circuit
This function is intended to be used administratively, when you want to break the fuse before you do administration on the service which the fuse protects. This can be used to e.g., carry out database maintenance. After maintenance, the administrator can reenable the circuit again.
Disabling a circuit dominates every other operation, except remove/1
.
circuit_enable(Name) -> ok
circuit_enable/1 administratively (re-)enables a fuse
This call is used to reenable a disabled circuit again. Always returns ok and is idempotent.
Use this command at the point in time where you are done with administrative fixes and want to resume normal operation of the fuse.
install(Name, Options) -> ok | reset | {error, Reason}
install/2 adds a new fuse to the running system.
A call install(N, Os)
will add a new fuse under the name N
with options given by Os
. Note that the options must match
the correct type, or a badarg
error will be thrown.
melt(Name) -> ok
melt/1 melts a fuse a little bit
A call to melt(N)
will melt fuse N
. This call always returns ok
and it is currently implemented synchronously.
remove(Name) -> ok
remove/1 removs a fuse
Given remove(N)
this removes the fuse under the name N
. This fuse will no longer exist.
reset(Name) -> ok | {error, not_found}
reset/1 resets a fuse
Given reset(N)
this resets the fuse under the name N
. The fuse will be unbroken with no melts.
run(Name, Func::fun(() -> {ok, Result} | {melt, Result}), Context::fuse_context()) -> {ok, Result} | blown | {error, not_found}
run/2 runs a thunk under a given fuse
Calling run(Name, Func)
will run Func
protected by the fuse Name
Generated by EDoc, Apr 29 2016, 23:23:30.