# io.github.libtmux.Channel.await

- **Module:** io.github.libtmux.Channel
- **Package:** io.github.libtmux:libtmux-kotlin
- **Language:** Kotlin
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-java/blob/f56392b5d9bc7f1f9c1631842333fb90f3d82d40/libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/Waits.kt#L27
- **Page:** https://libtmux.org/en/kotlin/latest/reference/io-github-libtmux-channel-await/

```
public suspend fun Channel.await(
    timeout: Duration,
    dispatcher: CoroutineDispatcher = Dispatchers.IO,
): WakeReason
```

Waits for something to signal this channel.

Cancelling the coroutine interrupts the wait. That is not a timeout. A `wait-for` tmux has already
accepted is not taken back.

## Parameters

- `timeout` (`Duration`): how long to wait, finite and positive
- `dispatcher` (`CoroutineDispatcher`): where the blocking wait runs

## Returns

why the wait ended
