Documentation
¶
Overview ¶
This sample demonstrates durable streaming with Firestore backend. Unlike in-memory streaming, Firestore-backed streams survive server restarts and can be accessed across multiple server instances.
Prerequisites:
- Firebase/GCP project with Firestore enabled
- Run: gcloud auth application-default login
- Set: export FIREBASE_PROJECT_ID=your-project-id
To run:
go run .
In another terminal, start a streaming request:
curl -N -i -H "Accept: text/event-stream" \
-d '{"data": 5}' \
http://localhost:8088/countdown
Note the X-Genkit-Stream-Id header. To reconnect to the same stream:
curl -N -H "Accept: text/event-stream" \
-H "X-Genkit-Stream-Id: <stream-id>" \
-d '{"data": 5}' \
http://localhost:8088/countdown
Click to show internal directories.
Click to hide internal directories.