Observation
A single-consumer guard over one Java subscription, for direct-style reading.
Source and package
- final class Observation[T] extends Auto
Closeable object Observation -
Description#
EventSubscriptionis already single-consumer by construction at the Java layer — a second concurrent read is refused — but that guard is scoped to one call; nothing stopped two directIterators built from the same subscription from interleaving reads across calls. This adds the same scoped-CAS discipline the Cats module's ownObservationalready had, so areadcall is the unit of exclusive ownership here too, released when it returns so a later sequentialreadstays legal.
Members4 members#
Common operations2 members#
- close method
- read method Runs
useover every step waiting or arriving withinpollTimeoutper poll, until the subscription closes. Rejects a second, overlappingreadon this observation.
Other members2 members#
- apply method
- droppedCount method The cumulative overflow count. A [[io.github.libtmux.control.Delivery$Gap Delivery.Gap]] read by
readsays where it sits.