Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 489 Bytes

File metadata and controls

19 lines (13 loc) · 489 Bytes

Basic Example

Minimal fibersse setup: one hub, one topic, one publisher, one browser client.

Run

go run main.go

Open http://localhost:3000 in your browser. You'll see events arriving every 3 seconds.

What it demonstrates

  • Creating a hub with fibersse.New()
  • Mounting the SSE handler with hub.Handler()
  • Publishing events from a background goroutine
  • Browser EventSource connecting and receiving typed events
  • Connection/disconnection lifecycle callbacks