class SseDecoder
source · line 10public class SseDecoder public constructor(limits: SseLimits = SseLimits(), initialLastEventId: String = "") : Closeable
- Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
An incremental UTF-8 event-stream parser with bounded line and event data. It tracks event IDs and retry hints but performs no reconnection or network I/O.
property isClosed
source · line 24public val isClosed: Boolean
get: public read-only
Whether local parser state has been closed.
getter get
source · line 24get(): Boolean
function receive
source · line 46public fun receive(buffer: NativeByteBuffer, count: Long = buffer.readableBytes): Long
Consumes a prefix of the readable buffer and advances by the returned count. A pending event can stop progress; drain events before supplying more bytes.
parameter count
source · line 46count: Long = buffer.readableBytes
parameter buffer
source · line 46buffer: NativeByteBuffer
function endInput
source · line 84public fun endInput(): Unit
Reports EOF and discards an unterminated event; a blank line is required for dispatch.
constructor constructor
source · line 10constructor(limits: SseLimits = SseLimits(), initialLastEventId: String = "")
parameter limits
source · line 10limits: SseLimits = SseLimits()
parameter initialLastEventId
source · line 10initialLastEventId: String = ""
property failure
source · line 40public val failure: Throwable?
get: public read-only
The retained parse failure, if the decoder has failed.
getter get
source · line 40get(): Option<Throwable>
property lastEventId
source · line 32public val lastEventId: String
get: public read-only
The current persistent event ID, including updates from ID-only events.
getter get
source · line 32get(): String
function nextEvent
source · line 74public fun nextEvent(): SseEvent?
Removes the next parsed event, or returns None when no event is ready.
property isFinished
source · line 28public val isFinished: Boolean
get: public read-only
Whether EOF has been reported and all pending complete events have been removed.
getter get
source · line 28get(): Boolean
property retryMilliseconds
source · line 36public val retryMilliseconds: Long?
get: public read-only
The latest valid nonnegative retry hint, in milliseconds.
getter get
source · line 36get(): Option<Long>
function close
source · line 95public override fun close(): Unit
- Overrides
close
Closes the parser and discards incomplete and queued data without network I/O.