SseEvent

Java-friendly factory for creating ServerSentEvent instances without trailing nulls.

The Ktor ServerSentEvent constructor requires all five parameters in Java because it lacks @JvmOverloads. This utility provides concise alternatives:

// Data-only (most common case)
SseEvent.data("Hello")

// Multiple fields
SseEvent.builder().data("Hello").event("chat").id("1").build()

Functions

Link copied to clipboard

Returns a new SseEventBuilder for constructing a ServerSentEvent with multiple fields.

Link copied to clipboard

Creates a ServerSentEvent with only the data field set.