Core Library0.xAPI reference

Choose documentation 3

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

method libtmux-java

EventSubscription.onReady

Arms a one-shot wakeup for when this subscription has something to read, or has ended.

Source and package
Qualified name
io.github.libtmux.control.EventSubscription.onReady
Package
io.github.libtmux.control
Declared in
EventSubscription
Distribution
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/control/EventSubscription.java

Description

Runs callback at once, on this thread, when a step is already waiting or the subscription has ended. Otherwise it runs once, on the control client's reader thread, when the first step arrives or the subscription ends, and is then disarmed: drain with #poll() until it is empty, then arm again. Checking and arming happen under the lock that delivery takes, so a step cannot slip between them unannounced.

The callback runs on the thread delivering events, so it must not block: resume a waiting coroutine, complete a promise, and return. One that throws is logged and ignored, and delivery continues.

Parameters
Errors
  • IllegalStateException – if a callback is already armed, or a stream or publisher owns this subscription

Recorded calls

source calls
No call edges in the Java model.

The Java reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls io.github.libtmux.control.EventSubscription.onReady.

Guides

task material

Pages that discuss onReady.

Esc
Search in

Type to search.

Reference previewOpen reference