Core LibraryAPI Reference

Choose documentation 3

latest

Current version

latest
English

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

method libtmux-java latest

EventSubscription.stream

Package io.github.libtmux.control.EventSubscription.stream io.github.libtmux.control

The steps still to come, in order, each read by the thread consuming the stream.

View as Markdown

Source and package
Module
io.github.libtmux.control
Declared in
EventSubscription
Package
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java
stream ( ) → java.util.stream.Stream<Delivery<T>>
method [source]

Description#

Pull-only: a step is read when the stream asks for one, and events that arrive meanwhile wait in this subscription's buffer, so its capacity alone decides what becomes a Delivery.Gap . The stream ends when this subscription closes. When the control client ended it, the stream fails with #cause() . Closing the stream closes this subscription, and closing this subscription from another thread ends a stream that is waiting.

Examples#

try (Stream<Delivery<PaneOutput>> steps = subscription.stream()) {
steps.map(Delivery::kept).forEach(output -> System.out.print(output.data()));
}
Raises
Esc

Type to search.