Libtmux_eio.with_private_daemon
Run f against a tmux daemon this call starts and owns, then stop it. The daemon listens on a socket in a fresh directory, created mode 0700 under root (default: the system temporary directory) and named with the prefix libtmux-ocaml-. It reads config_file, or nothing when none is given, instead of any default configuration. Neither TMUX nor TMUX_PANE reaches it. A root whose socket path would exceed the 107 bytes of a Unix socket address returns Libtmux.Error.Invalid_input before anything is created.
Source and package
- Qualified name
-
Libtmux_eio. with _private _daemon - Declared in
Libtmux_eio- Package
- libtmux-eio
- Source
- eio/libtmux_eio.mli
- val with_private_daemon : ?cleanup:Cleanup
.t -> ?binary:string -> ?config_file:string -> ?root:string -> ?session:string -> ?timeout:float -> process_mgr:[> [> `Generic ] Eio.Process.mgr_ty ] Eio.Process.mgr -> mono_clock:[> Eio.Time.Mono.ty ] Eio.Time.Mono.t -> (Libtmux.Endpoint -> 'a) -> ('a, Libtmux.t .Error ) result.t -
Public owner:
Libtmux_eioDescription
freceives theLibtmux.Endpoint.tonce the socket answers, withintimeoutseconds (default 5). The daemon stays alive until it is stopped, even with no session.Client.connectneeds a session to attach to, so passsessionto start the daemon with one detached session of that name, with a single window namedmainrunning/bin/cat -u, or create the first session withWorkspace.submit_bootstrap. Close every client made forendpointbeforefreturns.On every exit of
f, including an exception or Eio cancellation, the daemon is terminated and reaped, the call checks that nothing answers the socket, and the directory is removed. An exception fromfpropagates after cleanup, and a cleanup failure never replaces it; failures are retained incleanup. Whenfreturns, a cleanup failure is the result. A daemon that still answers, or one that cannot be reaped, leaves the directory in place and returnsLibtmux.Error.Filesystemor the cleanup error with its path. Normal return givesOkof the value off. The helper runsfin its own switch. The daemon's child process and cleanup are not cancellable: cancellation of the calling fiber waits for the daemon's termination before it propagates.- Parameters
-
-
binary? (string) -
config_file? (string) -
root? (string) -
session? (string) -
timeout? (float) -
process_mgr([> [> `Generic ] Eio.Process.mgr_ty ] Eio.Process.mgr) -
mono_clock([> Eio.Time.Mono.ty ] Eio.Time.Mono.t) -
arg1(Libtmux.Endpoint -> 'a).t
Recorded calls
source callsThe OCaml 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 Libtmux_eio.with_private_daemon.
Guides
task materialPages that discuss with_private_daemon.