Skip to main content

Module commands

Module commands 

Available on crate feature tokio only.
Expand description

Commands sent from the client handle to the event loop.

Each command contains two completion channels:

  • queued_tx is fired once the command’s session mutation has been made durable, regardless of connection state:

    • Subscriptions and QoS >= 1 publishes: after the persist that covers the stored filter / outbox entry succeeds (immediately after the mutation when no persistence is configured).
    • QoS 0 publishes: immediately on acceptance (no durable state).

    The Option wrapper allows the event loop to pre-fire the signal during the offline backoff phase and then process the wire send later.

  • completion_tx is fired when the broker acknowledges the operation (PUBACK / PUBCOMP / SUBACK / UNSUBACK). For QoS 0 publishes it is resolved when the bytes are written.

StructsΒ§

PendingAck πŸ”’
Held by the event loop for an in-flight SUBSCRIBE or UNSUBSCRIBE, keyed by packet id. The core now owns the filter list and the reason-code rules; the runtime only needs to resolve the user-facing future on the ack.
PendingPublish πŸ”’
Held by the event loop for each in-flight QoS >= 1 publish.
PublishCommand πŸ”’
A publish request from a client handle.
UserAck πŸ”’
A user future waiting for a SUBACK or UNSUBACK.

EnumsΒ§

Command πŸ”’