Skip to main content

ServerSentEvent

Represents a single Server-Sent Event.

Attributes

AttributeTypeDescription
dataAny = NoneThe event payload, which can be any JSON-serializable value and is always serialized to JSON, and is mutually exclusive with raw_data.
raw_data`strNone` = None
event`strNone` = None
id`strNone` = None
retry`intNone` = None
comment`strNone` = None

Constructor

Signature

def ServerSentEvent(
data: Any = None,
raw_data: str | None = None,
event: str | None = None,
id: str | None = None,
retry: int | None = None,
comment: str | None = None
)

Parameters

NameTypeDescription
dataAny = NoneThe event payload to be JSON-serialized.
raw_data`strNone` = None
event`strNone` = None
id`strNone` = None
retry`intNone` = None
comment`strNone` = None