ilusm.dev

sse

# sse - Server-Sent Events.

Load with: use sse

Quick example

use sse

result = sseev("value", 10)
prn(result)

Functions

SSE message structure

ssems()

Performs the operation.

sseev(m, n)

Performs the operation. Takes m, n.

ssid(m, i)

Performs the operation. Takes m, i.

sser(m, ms)

Performs the operation. Takes m, ms.

ssedt(m, ln)

Performs the operation. Takes m, ln.

Parse SSE message from string

ssepa(s)

Parses. Takes s.

Format SSE message to string

ssewr(m)

Writes data. Takes m.

Simple one-liner helpers

ssest(ev, dat)

Sets a value or starts a process. Takes ev, dat.

Parse SSE stream (multiple messages)

ssest(s)

Sets a value or starts a process. Takes s.

HTTP response headers for SSE

ssehd()

Performs the operation.

Filter handler (for srv/mw)

ssehd(h)

Performs the operation. Takes h.

Notes

  • Server-Sent Events - stream events to browser clients.