Skip to content

basalt / http/src / SseStream

Interface: SseStream ​

Defined in: http/src/sse.ts:20

Properties ​

closed ​

> readonly closed: boolean

Defined in: http/src/sse.ts:30

Methods ​

close() ​

> close(): void

Defined in: http/src/sse.ts:29

End the stream.

Returns ​

void


onClose() ​

> onClose(listener): void

Defined in: http/src/sse.ts:32

Run a listener when the client disconnects or the stream closes.

Parameters ​

listener ​

() => void

Returns ​

void


send() ​

> send(event): boolean

Defined in: http/src/sse.ts:27

Send an event (or a bare data string). Returns false if the stream is closed OR the transport's write buffer is full — a backpressure signal a producer should honour (await/slow down) to avoid unbounded memory growth with a slow client. No-op once closed.

Parameters ​

event ​

string | SseEvent

Returns ​

boolean

Released under the MIT License.