Skip to content

blackbull.protocol.stream

blackbull.protocol.stream

HTTP/2 stream state. Stream 0 belongs to the connection; native request state stays a Connection even on compatibility lanes.

Stream

HTTP/2 stream state with a native Connection dispatch target.

Stream 0 is connection-level state. Active requests are indexed as root children; legacy dependency priority frames do not build a scheduling tree. Client stream ids are odd; server push ids are even. Senders own default windows.

find_child(stream_id)

Find a stream id, returning None on a miss.

on_data_received(end_stream)

Transition state on DATA frame (RFC 9113 §5.1).

The peer's END_STREAM closes only their half: the stream becomes half-closed (remote), from which WINDOW_UPDATE / PRIORITY / RST_STREAM remain legal. Full CLOSED is reached when the server side finishes too (stream-task done-callback prunes the node) or via RST_STREAM.

on_headers_received(end_stream)

Transition state on HEADERS frame (RFC 7540 §5.1).

StreamState

Bases: Enum

HTTP/2 stream states per RFC 7540 §5.1.