ServerSentEvent
Represents a single Server-Sent Event.
Attributes
| Attribute | Type | Description |
|---|---|---|
| data | Any = None | The event payload, which can be any JSON-serializable value and is always serialized to JSON, and is mutually exclusive with raw_data. |
| raw_data | `str | None` = None |
| event | `str | None` = None |
| id | `str | None` = None |
| retry | `int | None` = None |
| comment | `str | None` = 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
| Name | Type | Description |
|---|---|---|
| data | Any = None | The event payload to be JSON-serialized. |
| raw_data | `str | None` = None |
| event | `str | None` = None |
| id | `str | None` = None |
| retry | `int | None` = None |
| comment | `str | None` = None |