Skip to content

Commit

Permalink
Allow fuses to be any term
Browse files Browse the repository at this point in the history
This was an artificial restriction in the code base. QuickCheck model
was extended to support any term, and things looked good. Hence we can
 safely lift the restriction we had here.
  • Loading branch information
jlouis committed Jun 23, 2021
1 parent 4ca9f1e commit a63f068
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/fuse.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
%% install/2
-spec install(Name, Options) -> ok | reset | {error, Reason}
when
Name :: atom(),
Name :: term(),
Options :: fuse_options(),
Reason :: any().
install(Name, Options) ->
Expand All @@ -54,7 +54,7 @@ install(Name, Options) ->
%% @end.
%% circuit_disable/1
-spec circuit_disable(Name) -> ok
when Name :: atom().
when Name :: term().
circuit_disable(Name) ->
fuse_server:circuit(Name, disable).

Expand All @@ -65,7 +65,7 @@ circuit_disable(Name) ->
%% @end
%% circuit_enable/1
-spec circuit_enable(Name) -> ok
when Name :: atom().
when Name :: term().
circuit_enable(Name) ->
fuse_server:circuit(Name, enable).

Expand All @@ -75,7 +75,7 @@ circuit_enable(Name) ->
%% run/3
-spec run(Name, fun (() -> {ok, Result} | {melt, Result}), fuse_context() ) -> {ok, Result} | blown | {error, not_found}
when
Name :: atom(),
Name :: term(),
Result :: any().
run(Name, Func, Context) -> fuse_server:run(Name, Func, Context).

Expand All @@ -86,15 +86,15 @@ run(Name, Func, Context) -> fuse_server:run(Name, Func, Context).
%% @end
%% ask/2
-spec ask(Name, fuse_context()) -> ok | blown | {error, not_found}
when Name :: atom().
when Name :: term().
ask(Name, Context) -> fuse_server:ask(Name, Context).

%% @doc Resets a fuse.
%% <p>Given `reset(N)' this resets the fuse under the name `N'. The fuse will be unbroken with no melts.</p>
%% @end
%% reset/1
-spec reset(Name) -> ok | {error, not_found}
when Name :: atom().
when Name :: term().
reset(Name) ->
fuse_server:reset(Name).

Expand All @@ -103,7 +103,7 @@ reset(Name) ->
%% @end
%% melt/1
-spec melt(Name) -> ok
when Name :: atom().
when Name :: term().
melt(Name) ->
fuse_server:melt(Name).

Expand All @@ -112,7 +112,7 @@ melt(Name) ->
%% @end
%% remove/1
-spec remove(Name) -> ok
when Name :: atom().
when Name :: term().
remove(Name) ->
fuse_server:remove(Name).

Expand Down

0 comments on commit a63f068

Please sign in to comment.