NAME

Hypersonic::Protocol::SSE - Server-Sent Events protocol support

SYNOPSIS

use Hypersonic::Protocol::SSE;

# Generate C code for SSE formatting
Hypersonic::Protocol::SSE->gen_event_formatter($builder);

DESCRIPTION

Server-Sent Events (SSE) provide a standard for pushing events from a server to a client over HTTP. This module provides compile-time C code generation for efficient event formatting.

SSE Format (RFC 8895)

event: message
id: 123
data: Hello World

event: update
data: line 1
data: line 2

: this is a comment/keepalive

retry: 3000

SSE FORMAT

Each event consists of:

  • event: name - Optional event type (default: "message")

  • id: value - Optional event ID for reconnection

  • data: payload - Required event data (can span multiple lines)

  • Blank line - Terminates the event

Special directives:

  • retry: ms - Sets reconnection delay in milliseconds

  • : comment - Comment line (ignored by client, used for keepalive)

AUTHOR

Hypersonic Contributors