Module outbound
Expand description
Outbound command handling: turning user commands and stored session state into wire packets, gated by the server’s Receive Maximum and Maximum Packet Size.
Functions§
- handle_
command 🔒 - Handles a single user command on a live connection.
- pump_
session 🔒 - Drains pending subscription groups, the outbox, and pending PUBRELs onto
the outbound buffer via the client’s
poll_transmit, mapping its per-packet events onto the user-facing futures: a written PUBLISH reportsSentprogress, every written packet (re-)arms its ack-timeout deadline, and an over-large packet fails its completion withError::PacketTooLarge. - register_
ack 🔒 - Tracks a recorded SUBSCRIBE/UNSUBSCRIBE’s completion future. The caller
pumps the session afterwards, which puts the group on the wire and arms
its ack deadline via
TransmitEvent::SubscribeSent/TransmitEvent::UnsubscribeSent. Shared tail ofsend_subscribeandsend_unsubscribe, which differ only in howpacket_idis obtained. - resubscribe_
confirmed 🔒 - Re-issues every confirmed subscription as a fresh SUBSCRIBE after a
Session Present = 0CONNACK so the broker re-establishes it. In-flight SUBSCRIBEs are not touched here: they are re-armed on connect and re-sent by the next session pump. Because each filter is a single entry, a filter is re-issued by exactly one path, so none goes out twice. A replay carries no user future, but it still gets apending.acksentry taggedAckCompletion::Internalso the pump arms an ack-timeout deadline for it like any other in-flight SUBSCRIBE. - send_
subscribe 🔒 - send_
unsubscribe 🔒