Permalink
Browse files

Make better use of `mod_state()` types for clarity

  • Loading branch information...
nickelization committed Jan 23, 2017
1 parent 81abacd commit 48bd28cd2586730f11e34d4449b34a28a22d28da
Showing with 8 additions and 6 deletions.
  1. +1 −1 src/riak_core_coverage_fsm.erl
  2. +7 −5 src/riak_core_vnode_worker.erl
@@ -104,7 +104,7 @@
-record(state, {coverage_vnodes :: [{non_neg_integer(), node()}],
mod :: atom(),
mod_state :: tuple(),
mod_state :: mod_state(),
n_val :: pos_integer(),
node_check_service :: module(),
vnode_selector :: vnode_selector(),
@@ -33,16 +33,18 @@
{gen_server, pulse_gen_server}]}).
-endif.
-type mod_state() :: term().
-record(state, {
module :: atom(),
modstate :: any()
modstate :: mod_state()
}).
-callback init_worker(partition(), Args :: term(), Props :: [{atom(), term()}]) ->
{ok, State :: term()}.
-callback handle_work(Work :: term(), sender(), State :: term()) ->
{reply, Reply :: term(), State :: term()} |
{noreply, State :: term()}.
{ok, mod_state()}.
-callback handle_work(Work :: term(), sender(), mod_state()) ->
{reply, Reply :: term(), mod_state()} |
{noreply, mod_state()}.
start_link(Args) ->
WorkerMod = proplists:get_value(worker_callback_mod, Args),

0 comments on commit 48bd28c

Please sign in to comment.