# LibTmux.Server.WaitForAsync

- **Module:** LibTmux.Server
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Server.Execution.cs#L131
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-server-waitforasync/

```
LibTmux.Server.WaitForAsync(request: WaitForRequest, cancellationToken: CancellationToken) -> Task
```

Waits on, signals, locks, or unlocks a tmux channel.

Waiting blocks until something else signals the channel, so a call that
waits does not return on its own.

## Parameters

- `request` (WaitForRequest): Which channel, and what to do with it.
- `cancellationToken` (CancellationToken): Cancels waiting for tmux's reply. For <see cref="TmuxWaitMode.Wait" />
this kills the client while tmux keeps its queue entry, eating the next
real signal — prefer <see cref="OpenWaitChannel" /> whenever a
<see cref="TmuxWaitMode.Wait" /> needs a deadline. For
<see cref="TmuxWaitMode.Lock" /> cancelling never kills the client, since
tmux hands a released lock to whichever queued client is still alive: the
client keeps running, and a lock it goes on to acquire is released again
automatically once this call has already given up on it.
