proxystore.stream.events¶
Event types.
Event
module-attribute
¶
Event = Union[
EndOfStreamEvent, NewObjectEvent, NewObjectKeyEvent
]
Event union type.
EndOfStreamEvent
dataclass
¶
EndOfStreamEvent(topic: str)
End of stream event.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> EndOfStreamEvent
NewObjectEvent
dataclass
¶
New object in stream event.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> NewObjectEvent
NewObjectKeyEvent
dataclass
¶
NewObjectKeyEvent(
topic: str,
key_type: str,
raw_key: list[Any],
evict: bool,
metadata: dict[str, Any],
store_config: StoreConfig,
)
New object key in stream event.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> NewObjectKeyEvent
from_key
classmethod
¶
from_key(
key: tuple[Any, ...],
*,
evict: bool,
metadata: dict[str, Any],
store_config: StoreConfig,
topic: str
) -> NewObjectKeyEvent
Create a new event from a key and metadata.
Source code in proxystore/stream/events.py
EventBatch
dataclass
¶
Batch of stream events.
Warning
All events must be for the same topic.
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> EventBatch
Create a new event instance from its dictionary representation.
Source code in proxystore/stream/events.py
event_to_dict
¶
event_to_dict(event: Event | EventBatch) -> dict[str, Any]
Convert event to dict.
Source code in proxystore/stream/events.py
event_to_bytes
¶
event_to_bytes(event: Event | EventBatch) -> bytes