tmux_server:with_owned/2
Start an owned daemon, run a callback in the calling process, then stop it. Performs start_owned/1 and token-based stop_owned/1 around the callback. With successful cleanup, returns {ok, Value} or re-raises the original callback exception. A returned error tuple is an ordinary callback value. Startup failure passes through without invoking the callback.
Source and package
- Qualified name
-
tmux_server: with _owned/2 - Declared in
tmux_server- Package
- libtmux_erlang
- Source
- apps/libtmux_erlang/src/tmux_server.erl
- with_owned(Options, Function) -spec with_owned(owned
_options (), fun((t()) -> Value)) -> {ok, Value} | {error, scope_failure () | map()}. -
Description#
Cleanup failure returns
scope_failure/0, including both server and ownership handles for inspection and an explicit stop retry. It preserves the callback outcome and cleanup evidence separately; it never claims timeout is retirement. Seewith_server/2for callback and separately allocated resource obligations.
Guides#
Pages that discuss with_owned/2.
- Topics