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. Process Transport - Package
- io.github.libtmux.transport
- Distribution
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/transport/ProcessTransport.java
-
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.waitForreleases 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#
- admissionBound method
- close method
- controlCarrier method
- execute method
- executeThroughCarrier method Runs one bounded request through a caller-owned process carrier.
- executeWaiting method
- observe method
- ProcessStarter interface
- ProcessTransport method A transport allowing four concurrent tmux processes.
- ResourceNotReclaimed class A worker could not be recovered. Distinct from
IllegalStateException, which this transport reserves for use after close. - StdoutPump class Reads standard output without ever blocking on the pipe.