HT2::MultiFrameWriter
Inherits Reference < Object
Optimized multi-frame writer that batches frame writes to minimize I/O operations and memory allocations. Supports zero-copy for DATA frames and efficient serialization for other frame types.
Constants
DEFAULT_BUFFER_SIZE = 65536
Default write buffer size (64KB)
MAX_BATCH_SIZE = 100
Maximum frames to batch before forcing a flush
Constructors
for_connection(connection : Connection) : MultiFrameWriter
Create a connection-specific writer
new(buffer_pool : BufferPool, adaptive_buffer_manager : AdaptiveBufferManager | Nil = nil, buffer_size : Int32 | Nil = nil)
SourceClass methods
write_data_frames(io : IO, stream_id : UInt32, data_chunks : Array(Bytes), end_stream : Bool = false) : Nil
Optimized batch writer for multiple DATA frames from the same stream
write_headers_with_continuations(io : IO, stream_id : UInt32, header_block : Bytes, end_stream : Bool = false, priority : PriorityData | Nil = nil, max_frame_size : UInt32 = DEFAULT_MAX_FRAME_SIZE) : Nil
Optimized writer for HEADERS + CONTINUATION frames
Instance methods
adaptive_buffer_manager
Sourceadd_prioritized_frames(frames : Array(PrioritizedFrame)) : Nil
Add prioritized frames that will be sent in priority order
buffer_pool
Sourcewrite_buffer
Sourcewrite_mutex
Source