yera.runtime.publisher
Provides publisher abstractions for streaming str (HTMX chunk) content.
Symbols
BasePublisher
ABCAbstract base class for all publisher implementations.
Methods
BasePublisher.push
push(
chunk: str,
) → NonePushes a chunk of data to the sink.
Parameters
The string fragment to be published.
BasePublisher.push_eof
push_eof() → NoneSignals that the end of the stream has been reached.
BasePublisher.push_pause
push_pause() → NoneSignals a temporary pause in the data stream.
Publisher
BasePublisherAn asynchronous publisher that queues fragments for consumption via an async iterator.
Methods
Publisher.push
push(
chunk: str,
) → NoneThread-safely pushes a chunk into the async queue.
Parameters
The string fragment to publish.
Publisher.push_eof
push_eof() → NoneThread-safely pushes the EOF sentinel into the async queue.
Publisher.push_pause
push_pause() → NoneThread-safely pushes the PAUSE sentinel into the async queue.
Publisher.stream
stream() → AsyncIterator[str | object]Yields fragments until EOF, leaving EOF in place for later readers.
ReplayPublisher
BasePublisherA Publisher-shaped sink that collects fragments synchronously for replay.
Methods
ReplayPublisher.push
push(
chunk: str,
) → NoneAppends a chunk to the internal collection.
Parameters
The string fragment to collect.
ReplayPublisher.push_eof
push_eof() → NoneNo-op: replay collects a bounded list, no EOF sentinel.
ReplayPublisher.push_pause
push_pause() → NoneNo-op: replay supplies its own close after the collected frames.
WebRenderContext
The web-transport context handlers render against.
Attributes
The publisher instance used to push content.
The URL associated with the current prompt.