# BR-STREAM-02

When a chunk opens a placeholder ("<<") without closing it, then everything is held back until it closes, then the whole placeholder is restored once.

Defined in [Show a streamed reply](https://docs.piighost.dev/en/domain/processes/show-a-streamed-reply/#br-stream-02).

## Where the rule lives

- [`_held_length()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/components/placeholder/streaming.py#L84)
- [`_split_buffer()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/components/placeholder/streaming.py#L106)

## Direct tests

No test calls this code directly.

## Indirect tests

- [`tests/components/placeholder/test_streaming_async.py::TestCustomDelimiters::test_custom_delimiters_are_recognized_across_chunks`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L193)
- [`tests/components/placeholder/test_streaming_async.py::TestCustomDelimiters::test_default_delimiters_ignore_a_different_grammar`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L203)
- [`tests/components/placeholder/test_streaming_async.py::TestFeed::test_feeding_then_flushing_yields_expected_text`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L109)
- [`tests/components/placeholder/test_streaming_async.py::TestFromFactory::test_factory_builds_a_matching_async_decoder`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L210)
- [`tests/components/placeholder/test_streaming_async.py::TestInventedToken::test_a_token_the_callback_keeps_is_emitted_unchanged`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L162)
- [`tests/components/placeholder/test_streaming_async.py::TestReplaceContract::test_replace_is_awaited_once_per_completed_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L146)
- [`tests/components/placeholder/test_streaming_async.py::TestReplaceContract::test_replace_is_not_awaited_for_plain_text`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L153)
- [`tests/components/placeholder/test_streaming_async.py::TestStreamInvariance::test_char_by_char_reconstructs_every_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L138)
- [`tests/components/placeholder/test_streaming_async.py::TestStreamInvariance::test_output_is_independent_of_chunk_size`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming_async.py#L132)
- [`tests/components/placeholder/test_streaming.py::TestFeed::test_feeding_then_flushing_yields_expected_text`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming.py#L46)
- [`tests/components/placeholder/test_streaming.py::TestFeed::test_split_delimiter_is_held`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming.py#L53)
- [`tests/components/placeholder/test_streaming.py::TestFromFactory::test_factory_builds_a_matching_decoder`](https://github.com/Athroniaeth/piighost/blob/master/tests/components/placeholder/test_streaming.py#L81)

## Used by

- [`AsyncPlaceholderStreamDecoder.feed()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/components/placeholder/streaming.py#L221)
- [`PlaceholderStreamDecoder.feed()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/components/placeholder/streaming.py#L171)

Read from the code graph graphify builds, at the places the domain documentation gives.
