anchor.diff:  %%
   
   handle_new_packet(Packet,QoS,_From,S = #state{live_subs = Subs,
  +                                              retained = Ret,
                                                 queue = SQ}) ->
   
       SQ1 = shared_queue:pushr({QoS,Packet},SQ),
  
positive.code:         error -> S
      end.
  
  recover(SubRecord,S) ->
      lists:foldl(fun recover_sub/2,S,SubRecord).
  
  
negative.code: handle_request_for_more(ClientId,FromSeq,WSize,S = #state{live_subs = Subs,
                                                            queue = SQ}) ->
      S1 = case dict:find(ClientId,Subs) of
              {ok,Sub = #sub{pid = Pid}} ->
                  MaxSeq = shared_queue:max_seq(SQ),
                  {ok,{From,To},Sub1} = packet_range_to_send(MaxSeq,FromSeq,WSize,Sub),
                  Packets = shared_queue:read(From,To,SQ),
                  S2 = S#state{live_subs = dict:update(ClientId,Sub1,Subs)},
                  send_packets_to_client(Pid,Packets,S2),
                  S2;
              error ->
                  S
          end,
      {ok,{reply,ok},S1}.
  
  handle_ack(ClientId,AckSeq,S = #state{queue = SQ,garbage = Garbage}) ->
  