pub struct AtomicSubscription<T> { /* private fields */ }Expand description
A Sync subscription that can be shared between threads, where each message will be delivered exactly once.
§Clone
Cloning an AtomicSubscription will create a new subscription at an identical position to the original.
In other words, if there are 10 pending events to consume and the subscription is cloned, the cloned subscription
will also have 10 pending events.
Note: This behavior means that cloning an AtomicSubscription results in different behavior than cloning
an Arc<AtomicSubscription>. The former will create a new subscription at the same point in the data stream,
while the latter will poll from the same subscription to share the load.
§Performance
The performance will be slightly worse than MutSubscription, but allows for multiple workers to share the load from
multiple threads by taking messages from a shared subscription as they are available.