Observation
A single-consumer guard over one Java subscription, for direct-style reading.
Source and package
- Qualified name
-
io.github .libtmux .scaladsl .streaming. Observation - Package
- io.github.libtmux.scaladsl.streaming
- Distribution
- io.github.libtmux:libtmux-scala_3
- Source
- libtmux-scala/src/main/scala/io/github/libtmux/scaladsl/streaming/Observation.scala
- 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.- Type parameters
-
-
TforObservation() [overload 1]
-
Members4 members
Common operations2
- close
- read Runs
useover every step waiting or arriving withinpollTimeoutper poll, until the subscription closes. Rejects a second, overlappingreadon this observation.
Other members2
- apply
- droppedCount The cumulative overflow count. A [[io.github.libtmux.control.Delivery$Gap Delivery.Gap]] read by
readsays where it sits.