Batches one terminal's output acks. The backend stops reading a terminal
whose output runs too far ahead of what this client has acked, so acks
must keep up with consumption without doubling the message rate.
Counts are the backend's: each terminal_data carries sent_bytes, the
terminal's running output total, and an ack echoes the sent_bytes of the
last chunk consumed. Acks are cumulative, so a lost one is covered by the
next.
An ack is sent at once when threshold_bytes of consumed output are
waiting, and after delay when fewer are — so the last of a burst is
always acked. At most one ack is in flight: output consumed meanwhile
waits for it to return and is then acked by the same rule, so under a
flood acks go out per threshold_bytes consumed, not per round trip
(each ack is a request the backend runs in a transaction).
Acks can't stall a terminal the backend has paused, as long as
threshold_bytes is at most the backend's low-water mark (see
TERMINAL_ACK_THRESHOLD_BYTES): once everything sent is consumed, at
least the threshold is waiting, and the ack goes out at once or as soon as
the one in flight returns. delay bounds every other case. Not reactive.