Function pump_session
pub(super) fn pump_session(
client: &mut Client<JournaledSession>,
outbound: &mut PacketWriter<GrowBuffer>,
pending: &mut Pending,
outbound_aliases: &mut OutboundAliases,
) -> Result<(), Error>Available on crate feature
tokio only.Expand description
Drains pending subscription groups, the outbox, and pending PUBRELs onto
the outbound buffer via the client’s
poll_transmit. It maps the per-packet events
onto the user-facing futures:
- A written PUBLISH reports
Sentprogress. - Each written packet (re-)arms its ack-timeout deadline.
- An over-large packet fails its future with
Error::PacketTooLarge. - A packet the server does not support fails its future with
Error::Client.
§Errors
Returns Error::Alloc if the outbound buffer or the alias table cannot
allocate. The session keeps the packets not yet written.