OxL Reference

enum SlowPolicy

What publish does when a subscriber has buffer unread elements.

Example:

oxl✓ checked in CI
use std.stream { Broadcast, SlowPolicy }

fn main() io {
  let hub = Broadcast<i32>.new(buffer: 2, slow: SlowPolicy.DropOldest)
  print("{hub.subscribers()}")
}
Output
0
pub(api) enum SlowPolicy

Since. 1.0.0-beta

Variants

Block

publish waits until the slowest subscriber has room.

DropOldest

The subscriber's oldest unread elements are dropped; sub.lagged() counts them.

Disconnect

The subscription ends with the error Lagged after the elements it already has.

Defined in: std/stream/stream.oxl:527

See also