NAME

LibTmux::Async::Transport - Bounded asynchronous process execution

METHODS

new

new(loop => $loop, max_concurrent => 4, max_queue => 64) borrows an IO::Async::Loop::Ppoll backed by IO::Ppoll. Construct that class explicitly; automatic loop selection can choose an unsupported backend. Other classes, a substituted poll implementation, or a wait mask blocking SIGCHLD throw Unsupported before dispatch. The loop owns supervisor reaping; competing external all-child reapers are unsupported. The library never runs, stops, or replaces it.

Ppoll blocks watched signals outside its atomic wait. Its shared SIGCHLD watch can outlive this transport. close leaves the caller-selected loop and its signal policy intact. Do not change the backend or its wait mask while jobs or cleanup remain active. Async children unblock only SIGCHLD before process supervision; other mask bits remain unchanged in the child. This lets a new tmux daemon observe pane exits without changing synchronous core's mask policy.

execute

Accepts the same literal process arguments as "run" in LibTmux::Transport. Returns a Future yielding one command result. Typed core exceptions remain the failure value. Queue overflow fails with QueueFull before dispatch. The backend is checked again at admission and launch. Child preparation failures retain a typed diagnostic and dispatched false, with supervisor exit still required before cleanup completes.

The shared LibTmux::ProcessJob owns supervision. Cancelling the Future requests cleanup; it does not prove exit or reverse command effects.

close

Begin idempotent shutdown and return a fresh observer Future. New admissions fail with Closed; queued requests are cancelled without dispatch and running jobs are cancelled. Cancelling an observer never cancels private cleanup. Only successful is_done completion proves all owned jobs, pipes, and watchers have completed cleanup. The borrowed loop remains usable. Callers must keep driving it through shutdown.