# tmux_stream:demand/2

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/38478dff54579a4f408005d0265031abdf3a880a/apps/libtmux_erlang/src/tmux_stream.erl#L104
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_stream-demand-2/

```
demand(Subscription, Credit)
-spec demand(subscription(), credit()) ->
                ok | {error, map()}.
```

Add credit for future deliveries. Unused credit plus delivered data awaiting acknowledgement must fit within 64 KiB and eight messages. An `await_timeout` leaves the credit change unconfirmed.

## Parameters

- `Subscription` (`subscription()`)
- `Credit` (`credit()`)

## Guides

Pages that discuss `demand/2`.

- [Control connections](/en/erlang/latest/topics/control/)
