# LibTmux.TmuxWait.UntilAsync

- **Module:** LibTmux.TmuxWait
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Waiting/TmuxWait.cs#L25
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-tmuxwait-untilasync/

```
LibTmux.TmuxWait.UntilAsync(probe: Func<CancellationToken, Task<bool>>, timeout: TimeSpan, interval: TimeSpan, throwOnTimeout: bool, cancellationToken: CancellationToken) -> Task<bool>
```

Waits until a probe reports the state was reached.

## Parameters

- `probe` (Func<CancellationToken, Task<bool>>): Answers whether the state has been reached.
- `timeout` (TimeSpan): How long to keep asking.
- `interval` (TimeSpan): How long to wait between askings.
- `throwOnTimeout` (bool): Whether running out is a failure.
- `cancellationToken` (CancellationToken): Cancels the wait.

## Returns

True when the state was reached.

## Raises

- `TmuxWaitTimeoutException`: The state was not reached and running out was to be a failure.
