anchor.diff:  -author("Christopher S. Meiklejohn <christopher.meiklejohn@gmail.com>").
   
   -behaviour(gen_server).
  -
  --define(BROADCAST_INTERVAL, 30000).
   
   %% API
   -export([start_link/0,
  
positive.code: 
  handle_cast({buffer, {Id, _Type, _Metadata, _Value} = Payload},
              #state{buffer=Buffer0}=State) ->
      lasp_logger:extended("Buffering update for ~p", [Id]),
  
      Buffer = case lasp_config:get(broadcast, false) of
          true ->
              %% Buffer latest update for that state.
  
negative.code: schedule_broadcast() ->
      case lasp_config:get(broadcast, false) of
          true ->
              Interval = lasp_config:get(aae_interval, 10000),
              %% Add random jitter.
              Jitter = rand_compat:uniform(Interval),
              timer:send_after(Interval + Jitter, perform_broadcast);
          false ->
              ok
      end.
  