anchor.diff:      ReqType = req_type(GrainRef),
       do_for_ref(GrainRef, fun(Pid) ->
                                try
  -                                 gen_server:call(Pid, {ReqType, Request}, Timeout)
  +                                 gen_statem:call(Pid, {ReqType, Request}, Timeout)
                                catch
                                    exit:{bad_etag, _} ->
                                        lager:error("at=grain_exit reason=bad_etag", []),
  
positive.code: -spec cast(GrainRef :: erleans:grain_ref(), Request :: term()) -> Reply :: term().
  cast(GrainRef, Request) ->
      ReqType = req_type(GrainRef),
      do_for_ref(GrainRef, fun(Pid) -> gen_server:cast(Pid, {ReqType, Request}) end).
  
  req_type(GrainRef) when is_map(GrainRef) -> refresh_timer;
  req_type(GrainRef) when is_pid(GrainRef) -> leave_timer.
  
negative.code: -type cb_state() :: term() | #{persistent := term(),
                                 ephemeral  := term()}.
  
  -type action() :: save_state | {save, any()}.
  
  %-type state() :: active | deactivating.
  
  -callback activate(Ref :: erleans:grain_ref(), Arg :: term()) ->
      {ok, Data :: cb_state(), opts()} |
      ignore |
      {stop, Reason :: term()}.
  
  