example

command
v0.0.0-...-62e1376 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 9 Imported by: 0

README

SSE Example

This example demonstrates Server-Sent Events (SSE) meta-process implementation for Ergo Framework.

Server

Starts HTTP server on localhost:8080 with:

  • / - HTML page with embedded SSE client (view in browser)
  • /events - SSE endpoint

The server sends periodic events every 2 seconds with counter, server time, and connected clients count.

go run ./server.go

Open http://localhost:8080 in browser to see live updates.

Client

Connects to SSE endpoint and prints received events to console.

go run ./client.go

Message Types

  • sse.MessageConnect - connection established
  • sse.MessageDisconnect - connection closed
  • sse.Message - SSE event with Event, Data, MsgID, Retry fields
  • sse.MessageLastEventID - client reconnected with Last-Event-ID header

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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