Event

@Serializable
data class Event(val id: String, val type: EventType, val payload: EventPayload = EmptyPayload(), val timestamp: Long = Clock.System.now().toEpochMilliseconds(), val eventId: String = Uuid.random().toString())(source)

The wire envelope every SSE / event-bus message rides in.

id is assigned by the producer and used by krill.zone.shared.events.EventTracker for deduplication — distinct from eventId, which is a fresh UUID per envelope so retransmits can be correlated. timestamp defaults to Clock.System.now() so producers that don't care about wall-clock can just call Event(id, type, payload).

Constructors

Link copied to clipboard
constructor(id: String, type: EventType, payload: EventPayload = EmptyPayload(), timestamp: Long = Clock.System.now().toEpochMilliseconds(), eventId: String = Uuid.random().toString())

Properties

Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard