02 – Streaming Response with Disconnect Handling

Shows how to:

Quick Start

1. Start the server:

pagi-server --app examples/02-streaming-response/app.pl --port 5000

2. Demo with curl:

# Watch chunks stream in (one per second)
curl -N http://localhost:5000/
# => Chunk 1
# => Chunk 2
# => Chunk 3

# Test disconnect handling - press Ctrl+C during streaming
curl -N http://localhost:5000/
# (press Ctrl+C to see server handle disconnect)

Spec References

Covered by the PAGI specification in the upstream PAGI distribution (PAGI::Spec POD and protocol documents, https://github.com/jjn1056/pagi):