SSE client-shape contract checks — token swap mode and eager connect.
contracts.rules_sse_client_shape
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Classify EventStream generators as one-shot or per-token Fragment yields.
Return(event_name, replaces, swap_mode) for each sse-swapsink.
Warn when a multi-Fragment SSE stream uses replace swaps instead of append.
Info when a full page statically connects to SSE on first paint.
_FragmentYieldVisitor
class
Classify EventStream generators as one-shot or per-token Fragment yields.
_sse_swap_sinks
function
def _sse_swap_sinks(source: str) -> list[tuple[str, bool, str]]
Return(event_name, replaces, swap_mode) for each sse-swapsink.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
source
|
str
|
— |
check_sse_token_swap_mode
function
def check_sse_token_swap_mode(template_sources: dict[str, str], router: Router) -> list[ContractIssue]
Warn when a multi-Fragment SSE stream uses replace swaps instead of append.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
template_sources
|
dict[str, str]
|
— | |
router
|
Router
|
— |
check_sse_eager_connect
function
def check_sse_eager_connect(template_sources: dict[str, str]) -> list[ContractIssue]
Info when a full page statically connects to SSE on first paint.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
template_sources
|
dict[str, str]
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/contracts/rules_sse_client_shape.py:1