Multi-user realtime chat over Server-Sent Events and the in-process
bus
provider.
- The page opens an
EventSourceto/events, which ranges{{.Bus.Subscribe "messages"}}and streams each message with.Flush.SendSSE. - The form
POSTs to/messages, which calls{{.Bus.Publish "messages" …}}. - Open two browser tabs to see messages fan out to every connected client.
mise run example-sse-chatThen open http://localhost:9002/
For multi-process messaging (or request/reply, durable streams), swap bus
for the nats
provider instead.