Session-scoped signal SSR seeding middleware.
Seeds the signal registry cache for session-scoped signals on each request and
binds the per-visitor SSE audience key used bysignal_connect().
RequiresSessionMiddleware(for session identity) and should run after
AuthMiddleware when require_authenticated=Trueso anonymous visitors
receive global-only bindings.
middleware.session_signals
| 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
Configuration forSessionSignalMiddleware.
Seed session-scoped signal SSR values and bind the SSE audience key.
Usage::
app.add_middleware(SessionSignalMiddleware(SessionSignalConfig(
app=app,
audience_key=lambda: session_store.session_key(),
seeds=lambda: {"balance": load_balance(), "notifications": load_notes()},
)))
SessionSignalConfig
class
Configuration forSessionSignalMiddleware.
SessionSignalMiddleware
class
Seed session-scoped signal SSR values and bind the SSE audience key.
Usage::
app.add_middleware(SessionSignalMiddleware(SessionSignalConfig(
app=app,
audience_key=lambda: session_store.session_key(),
seeds=lambda: {"balance": load_balance(), "notifications": load_notes()},
)))
View source · /home/runner/work/chirp/chirp/site/../src/chirp/middleware/session_signals.py:1