sse

command
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

This example shows how to use Server Sent Events (SSE) with Huma to send messages to a client over a long-lived connection.

# Connect and start getting messages
curl localhost:8888/sse

You can connect an arbitrary number of clients in many tabs/terminals and they will all receive the same data from a single producer on the server. Disconnect (Ctrl-C) & reconnect to continue the sequence.

                      /--> channel -> Client 1
Producer -> SSE message -> channel -> Client 2
                      \--> channel -> Client 3

Jump to

Keyboard shortcuts

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