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.

class libtmux-java latest

ProcessTransport

The default transport: one child process per call, drained by a bounded pool of platform threads.

Source and package
Qualified name
io.github.libtmux.transport.ProcessTransport
Package
io.github.libtmux.transport
Distribution
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/transport/ProcessTransport.java
class io.github.libtmux.transport.ProcessTransport

Description#

A caller takes one admission permit before launching, and the pool holds exactly three workers per permit, so holding a permit means both drains and the input pump are already free. Without that coupling a caller can start a child whose pipes nobody is reading, or block forever writing to one that stopped reading.

A request declared as waiting also takes one of all but one admission permits. The remaining process stays available for the ordinary request that observes or releases those waits, without increasing the total process or pump bound. An additional waiter is refused before dispatch, so its caller knows it was never registered.

The caller itself may be a virtual thread: Process.waitFor releases its carrier. The drains stay platform threads, although on JDK 25 neither a monitor nor a pipe read pins a virtual thread any more. A virtual thread is always a daemon, and a drain has to finish the reply it is reading rather than be dropped at exit; and a library does not own the scheduler, where a caller's CPU-bound task that never blocks keeps its carrier and a drain waiting behind it lets the pipe fill.

Launching and closing are ordered by an explicit gate rather than a flag, because checking a flag and then acting on it lets a caller start a child after close() has already decided there was nothing left to destroy.

Members11#

Esc

Type to search.

Reference previewOpen reference