# Base.close

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/process.jl#L167
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-base-close/

```
close(subscription::LibTmux.CancellationSubscription)

close(connection::LibTmux.ControlConnection)

close(stream::LibTmux.ObservationStream)

close(owned::LibTmux.OwnedServer)
```

## Methods

### `close(subscription::LibTmux.CancellationSubscription)`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/process.jl#L167).

### `close(connection::LibTmux.ControlConnection)`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control.jl#L1005).

### `close(stream::LibTmux.ObservationStream)`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/observation.jl#L642).

### `close(owned::LibTmux.OwnedServer)`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/lifecycle.jl#L137).

Stop only the spawned daemon, reap it, join its watchers, and remove its owned directory. Concurrent calls serialize; later calls return `nothing`. Shutdown sends SIGTERM and permits 900 ms for exit and diagnostic drainage. If SIGKILL or forced pipe closure is needed, cleanup completes before throwing `OwnedServerCleanupError`. A replaced ownership marker prevents directory removal. Cleanup never sends `kill-server` to an endpoint.

```julia
close(owned::OwnedServer)
```

## Parameters

- `subscription` (`LibTmux.CancellationSubscription`) (for `Base.close(subscription)`)
- `connection` (`LibTmux.ControlConnection`) (for `Base.close(connection)`)
- `stream` (`LibTmux.ObservationStream`) (for `Base.close(stream)`)
- `owned` (`LibTmux.OwnedServer`) (for `Base.close(owned)`)
