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 (soqueued()reflects real persistence) and their completion futures are parked inoffline_pendinguntil 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. QoS0 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 withError::QueueFullrather than growing memory without bound.