process_command_offline

Function process_command_offline 

pub(super) fn process_command_offline(
    cmd: Command,
    client: &mut Client<JournaledSession>,
    queued: &mut VecDeque<Command>,
    offline_pending: &mut HashMap<PacketId, PendingPublish>,
    offline_acks: &mut HashMap<PacketId, PendingAck>,
    queued_waiting: &mut Vec<Sender<Result<(), Error>>>,
)
Expand description

Handles a command received while the client is offline (in the reconnect backoff phase), with a bound on how much may be buffered.

  • QoS >= 1 publishes are stored as durable session state immediately (so queued() reflects real persistence) and their completion futures are parked in offline_pending until the next connection adopts them.
  • SUBSCRIBE/UNSUBSCRIBE are likewise recorded as durable in-flight entries and their futures parked in offline_acks; they are sent when the next connection drains the pending requests.
  • QoS 0 publishes have no durable state and are deferred best-effort by re-queuing.
  • Once the buffered work reaches OFFLINE_QUEUE_LIMIT, new operations are rejected with Error::QueueFull rather than growing memory without bound.