# Libtmux_unix.Cancellation.with_

- **Module:** Libtmux_unix
- **Package:** libtmux-unix
- **Language:** OCaml
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/unix/libtmux_unix.mli#L68
- **Public owner:** Libtmux_unix
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_unix-cancellation-with_/

```
val with_ : (t -> 'a) -> 'a
```

Own a cancellation token for the callback's lifetime. Leaving the scope cancels outstanding waiters and releases its descriptors after they finish. An escaped token is cancelled and cannot be reused.

## Parameters

- `arg1` (`t -> 'a`)

## Guides

Pages that discuss `with_`.

- [Submit actions and retain their outcomes](/en/ocaml/latest/guides/control/)
