anchor.diff:      code_change/3]).
   
   -record(state, {
  -    queue = ?QUEUE:new() :: queue(),
  +    queue = queue:new() :: queue(),
       max_entries = ?DEFAULT_MAX_ENTRIES :: pos_integer()
   }).
   
  
positive.code: %@hidden
  recover_fail(ID, Queue) ->
      Now = apns:expiry(0),
      List = ?QUEUE:to_list(?QUEUE:filter(fun
          (#apns_msg{expiry=Expiry}) -> Expiry > Now
      end, Queue)),
      DropWhile = fun(#apns_msg{id=I}) -> I =/= ID end,
  
negative.code:     {stop, normal, State};
  
  handle_cast({in, Msg}, #state{max_entries=MaxEntries,queue=OldQueue}=State) ->
      Queue = case MaxEntries =< queue:len(OldQueue) of
          true -> queue:liat(OldQueue);
          false -> OldQueue
      end,
      {noreply, State#state{queue = queue:in(Msg, Queue)}};
  
  handle_cast(_Msg, State) ->
      {noreply, State}.
  