anchor.diff:    maps:fold(FoldFun, orddict:new(), AgentCache).
   
   
  +%%--------------------------------------------------------------------
  +%% @private
  +%% @doc
   %% Wrapper fun to make task_fold into a higher order function
   %% It's a separate function to avoid capturing excessive
   %% local variables
  +%% @end
  +%%--------------------------------------------------------------------
   task_fold_fun(AgentIPs) ->
     fun (Task, Acc) ->
       try task_fold(AgentIPs, Task, Acc) of
  
positive.code:     {error, Reason} ->
        lager:warning("Could not poll: ~p", [Reason]),
        State;
      {ok, NewVips} ->
        NewVips
    end,
    {noreply, NewState};
  handle_info(_Info, State) ->
  
negative.code:   lager:debug("Bad HTTP Response: ~p", [Response]),
    {error, http_error}.
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% If a master has been seen for longer than the agent reregistration
  %% timeout, we can expect any previously-seen agents to have checked-in.
  %% If they have not, the mesos master will kill its tasks if it
  %% reregisters in the future. Because these tasks are marked-for-death
  %% we can safely remove them from our cache.
  %% @end
  %%--------------------------------------------------------------------
  -spec(filter_old_agents(State :: #state{}, ElectedTime :: float(), Now :: integer()) -> #state{}).
  filter_old_agents(State = #state{last_master_elected = LastMaster,
                                   last_master_elected_local_time = LastMasterTime,
  