realtime

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package realtime provides request-time presentation-event fanout helpers for generated apps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PresentationFanout

type PresentationFanout = contracts.PresentationFanout

PresentationFanout sends browser-facing presentation events.

type SSEHub

type SSEHub = sse.Hub

SSEHub fans presentation events out to connected server-sent events clients.

func NewSSE

func NewSSE(options ...SSEOption) *SSEHub

NewSSE creates a dependency-free server-sent events presentation fanout hub.

type SSEOption

type SSEOption = sse.Option

SSEOption configures a dependency-free SSE hub.

func WithSSEAudienceFromRequest added in v0.8.0

func WithSSEAudienceFromRequest(fn func(*http.Request) []string) SSEOption

WithSSEAudienceFromRequest assigns server-owned audience labels to one SSE client. Scoped presentation events are delivered only when every event label is present in the client audience set.

func WithSSEBufferSize

func WithSSEBufferSize(size int) SSEOption

WithSSEBufferSize sets each SSE client's queued message buffer.

func WithSSEReplayLimit added in v0.12.0

func WithSSEReplayLimit(limit int) SSEOption

WithSSEReplayLimit keeps a bounded in-memory replay buffer for browser reconnects that send Last-Event-ID.

func WithSSERetryMillis added in v0.12.0

func WithSSERetryMillis(milliseconds int) SSEOption

WithSSERetryMillis sets the browser EventSource reconnect delay advertised by the generated SSE stream.

type SSEStats added in v0.12.0

type SSEStats = sse.Stats

SSEStats reports process-local SSE hub counters for app-owned metrics export.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL