pub struct SubscriptionSender<M> { /* private fields */ }Expand description
A bounded message sender supplied to a running subscription.
The runtime shares a 256-message queue across subscriptions and dispatches at most 64 messages per iteration before returning to input/render work. These are message-count limits, not byte limits on arbitrary model messages. Producers should also bound the size of each message they construct.
Clones share both queue capacity and the subscription’s stop signal.
Implementations§
Source§impl<M> SubscriptionSender<M>
impl<M> SubscriptionSender<M>
Sourcepub fn send(&self, message: M) -> Result<(), SendError<M>>
pub fn send(&self, message: M) -> Result<(), SendError<M>>
Send a message, applying backpressure while the queue is full.
Returns the unsent message if the receiver disconnects or cancellation interrupts a full-queue wait. An immediate send may still succeed after cancellation, allowing a final status when capacity is available. Final status delivery is not guaranteed after cancelling a full queue. Implementations must still check their stop signal before producing work.