READ BYTES · FRAME EVENTS · CONSUME
HTTP response body: separate reads from decoded events
Fragment real encoded bytes, inspect the parser buffer and follow complete events into an ordered text consumer.
Text source and visible output
Appended output
Unparsed buffer: first 32 bytes in hex
Your experiment
Change the byte read size while leaving event text unchanged. Explain why read boundaries and event boundaries differ. No real HTTP connection or network stack runs in this lesson.
The text is split into six-code-point deltas, numbered from 1. A source fault targets event 3, or the last event when fewer than three exist. Output is appended only after a complete frame is parsed and consumer processing finishes.
In streaming mode a full application queue pauses reads; one additional event may be processing. In buffered mode all body bytes arrive before parsing begins. The same 60-second inspection maps proportionally to each scenario’s modeled duration; it is not a network performance measurement.
Recent parser and consumer events
Original event fixtures
Offline byte-framing lesson. SSE parsing supports only the generated LF-delimited id/data subset; this is not a complete EventSource implementation. The alternative uses a zero compression byte plus four-byte big-endian payload length and UTF-8 JSON, not Protobuf. No HTTP/2 frames, headers, trailers, grpc-status, compression, TLS, provider API, A2A envelope, retries or reconnect/resume are implemented. The queue policy is application backpressure, not transport flow control. Duplicate suppression and strict contiguous event IDs are explicit application policies, not guarantees supplied by SSE/gRPC. Missing IDs are rejected without reordering or replay. Empty source is complete with no output; an incomplete frame remains truncated. SSE specification · gRPC message framing.
Separate a body read from an application event
An HTTP response body can reach an application in fragments that do not match logical event boundaries. This experiment compares two consumption policies over the same encoded content. Incremental consumption releases a complete framed record as soon as parsing and queue space allow. Full-body buffering defers parsing until all wire bytes have been read. The byte count alone cannot tell you how much text the user has seen: records still need validation and consumer processing before their deltas appear.
Control the byte and application boundaries
Local text supplies the payload, with the browser limiting entry to one hundred twenty UTF-16 code units. The model groups Unicode code points into records of up to six, each with a sequence identifier and delta string. Framing format selects the LF-delimited SSE subset or an uncompressed five-byte gRPC-style prefix around JSON. Application consumption either parses complete events incrementally or waits for the full body. Bytes per read changes fragmentation, Read interval changes scheduled arrival spacing, Processing per event changes consumer time, and Queued events bounds waiting records separately from the one active record. Parameter edits rebuild the scenario and start inspection unless reduced motion is requested.
Compare first output and buffering
Choose SSE framing, read size sixty-four, read interval one hundred milliseconds, consumer processing one thousand milliseconds and one waiting queue slot. Run incremental consumption and record first-output time, peak buffered bytes and read-paused time. Switch to full-body buffering with every other input unchanged. The fixture receives the complete body before consuming it, so its first output is later and its peak byte buffer is larger. Both can eventually produce the same text. This isolates the application buffering policy rather than claiming that a protocol name alone guarantees a better time to first output.
Inject failures and inspect safely
Source event fault repeats, omits or corrupts the third event, or the last available event for a shorter source; truncation removes the final three wire bytes. Ignore already-applied event IDs affects duplicate records only. Missing or malformed records can leave a sequence gap, and later records are rejected rather than reordered or replayed. Play and Pause inspect sixty seconds of viewing time; Next event advances a recorded scheduler transition; Restart inspection rewinds; Speed adjusts viewing pace; Inspection time scrubs. Visible output, pending-byte hex and recent events reflect the inspected prefix. The complete-run preview and original event list describe the full scenario, not work already consumed.
Define the release check narrowly
The final complete status requires exact reconstructed text, all original sequence identifiers applied, no rejected events and no incomplete bytes. It is useful evidence for this local body decoder but is not an HTTP integration test. There are no response headers, transfer coding, proxy buffering, cancellation, TLS, compression negotiation, server timeouts or browser fetch requests. The scheduler uses synthetic millisecond values mapped to a fixed inspection minute; its completion time is not a benchmark. A deployment still needs real transport tests in addition to this framing experiment.