Core Library0.xAPI reference

Choose documentation 1

pr-173

Current version

pr-173
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

function libtmux-elixir

Server.with_owned/2

Starts a private server, calls fun with it and stops it afterwards.

Source and package
Qualified name
LibTmux.Server.with_owned/2
Module
LibTmux
Declared in
Server
Package
libtmux
Source
lib/libtmux/server.ex
with_owned(options, fun) @spec with_owned([start_option()], (t() -> result)) :: result when result: term()

Description

Takes the options of start/1. Returns the value of fun. A start failure raises its LibTmux.Error before fun runs. The server stops when fun returns, raises, throws or exits. If fun completes and the stop fails, with_owned/2 raises the stop error; a failing stop never replaces an exception from fun.

Type parameters
Parameters

Examples

alias LibTmux.Server
Server.with_owned([executable: System.find_executable("tmux")], fn server ->
command = {:argv, ["/bin/cat"]}
{:ok, _} = Server.new_session(server, "demo", command: command)
Server.snapshot!(server)
end)

Recorded calls

source calls
No call edges in the Elixir model.

The Elixir 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.Server.with_owned/2.

Guides

task material

Pages that discuss with_owned/2.

Esc
Search in

Type to search.

Reference previewOpen reference