anchor.diff:  -export([init/1, callback_mode/0, terminate/3, code_change/4]).
   
   %% state API
  --export([unconfigured/3, configuring/3, batching/3]).
  +-export([unconfigured/3, configuring/3, batching/3, reapplying/3]).
   
   -define(SERVER, ?MODULE).
   -define(HEAPSIZE, 100). %% In MB
   -define(KILL_TIMER, 300000). %% 5 min
   -define(LISTEN_TIMEOUT, 5000). %% 5 secs
  +-define(REAPPLY_TIMEOUT, 300000). %% 5 min
   
   -include_lib("stdlib/include/ms_transform.hrl").
   
  
positive.code:     lager:debug("Done applying configuration: ~p", [DeltaConfig]),
      NewConfig = update_config(DeltaConfig, OldConfig),
      Data1 = Data0#data{config = NewConfig},
      {next_state, batching, Data1};
  configuring(info, _EventContent, _Data) ->
      {keep_state_and_data, postpone}.
              
  batching(info, EventContent, _Data) ->
      {keep_state_and_data, {timeout, ?LISTEN_TIMEOUT, {do_configure, EventContent}}};
  batching(timeout, {do_configure, EventContent}, Data) ->
      {next_state, configuring, Data, {next_event, internal, EventContent}}.
  
  %% private API
  
  
negative.code:     ref :: reference(),
      pid :: undefined | pid(),
      config = maps:new() :: config(),
      overlaykeys = [] :: [term()],
      kill_timer :: undefined | timer:tref()
  }).
  
  