GRPC::Transport::LiveSendBuffer
LiveSendBuffer is an on-demand queue for full-duplex bidi streaming. DATA_READ_CB_LIVE returns NGHTTP2_ERR_DEFERRED when the queue is empty, and the caller must call session_resume_data after pushing new data.
When capacity > 0 the buffer is bounded: push blocks the calling fiber until a slot is available, providing backpressure to the sender. capacity == 0 (default) means unbounded.
Lock ordering: callers must NOT hold @lsb_mutex while acquiring the connection @mutex. read_into is called from inside the connection @mutex, so it acquires @lsb_mutex as an inner lock — which is safe because push/close always release @lsb_mutex before the caller acquires the connection @mutex (via send_resume_proc).
Constructors
Instance methods
read_into fills buf with up to length bytes from the queue. Returns the number of bytes written, sets DATA_FLAG_EOF when done, or returns NGHTTP2_ERR_DEFERRED when no data is available yet. Called from DATA_READ_CB_LIVE while the connection @mutex is held.