Core Library0.xAPI reference

Choose documentation 1

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

class libtmux-scala

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 AutoCloseableobject Observation

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 Iterators 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.

Type parameters
  • T for Observation() [overload 1]

Members4 members

Common operations2

  • close
  • read 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

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

Type to search.

Reference previewOpen reference