anchor.diff:      Packet = mqtt_session:to_publish(CTRPacket,Retained,QoS,PacketId,false),
       send_to_client(Sender,Packet).
   
  -cleanup(#state{session = SO, client_id = ClientId}) ->
  -    mqtt_reg_repo:unregister(ClientId),
  -    mqtt_session:cleanup(SO).
  -
   maybe_persist(S) ->
       %% @todo: handle persistence
       S.
  
positive.code:     send_to_client(Sender, Packet);
  
  send_to_client(Sender, Packet) ->
      mqtt_sender:send_packet(Sender, Packet).
negative.code:     {noreply,S};
  
  handle_cast({force_close, _Reason}, S) ->
      %% cleanup(S),
      {stop, normal, S};
  
  handle_cast(_Request, State) ->
  