Core LibraryAPI Reference

Choose documentation 1

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

class libtmux-scala latest

Observation

Package io.github.libtmux.scaladsl.streaming.Observation io.github.libtmux.scaladsl.streaming

A single-consumer guard over one Java subscription, for direct-style reading.

View as Markdown

Source and package
Module
io.github.libtmux.scaladsl.streaming
Package
io.github.libtmux:libtmux-scala_3
Source
libtmux-scala/src/main/scala/io/github/libtmux/scaladsl/streaming/Observation.scala
final class Observation[T] extends AutoCloseableobject Observation
class [source]

Description#

EventSubscription is 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 direct Iterator s built from the same subscription from interleaving reads across calls. This adds the same scoped-CAS discipline the Cats module's own Observation already had, so a read call is the unit of exclusive ownership here too, released when it returns so a later sequential read stays legal.

Members4 members#

Common operations2 members#

  • close method
  • read method Runs use over every step waiting or arriving within pollTimeout per poll, until the subscription closes. Rejects a second, overlapping read on this observation.

Other members2 members#

  • apply method
  • droppedCount method The cumulative overflow count. A [[io.github.libtmux.control.Delivery$Gap Delivery.Gap]] read by read says where it sits.
Esc

Type to search.