# limits.DispatchLimits

- **Module:** limits
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/limits.rs#L109
- **Page:** https://libtmux.org/en/rs/latest/reference/limits-dispatchlimits/

How much work one server may have in flight at once.

Every dispatch is a tmux client process with its own pipes and reader
tasks. Without a ceiling, a caller that fans out -- an agent driving the
MCP server, a reconciler sweeping every pane -- turns its own concurrency
into process, descriptor, and memory pressure on the machine, and tmux
itself serializes on the far side regardless.

The client [`Server::wait_for_channel`](crate::Server::wait_for_channel)
parks on a channel is the exception, and is not counted: it is waiting
rather than working, and what releases it is a dispatch of its own.

## Example

```rust
use libtmux::DispatchLimits;

let limits = DispatchLimits::default().max_in_flight(4);
assert_eq!(limits.in_flight(), 4);
```

## Members

- `DEFAULT_IN_FLIGHT` (constant): How many dispatches may run at once by default.
- `max_in_flight` (method): Set how many dispatches may run at once.
- `acquire_timeout` (method): How long a dispatch waits for a permit before giving up.
- `in_flight` (method): How many dispatches may run at once.
