Weather sensor pipeline
The full flow of the reference TelemetryPipeline sample, in C#: a cron trigger looks in D1 for the sensors that are due, puts one job per sensor on a queue, the consumer takes a lease at a RateGate Durable Object so only one outbound call runs at a time, calls the weather API with a timeout and writes the reading back to D1. A failing call is retried with a growing delay, and when the provider cannot be reached at all the reading is marked as simulated, so the sample keeps working offline.
The flow
Every node lights up while it has work: a queued job, a held lease or a fresh reading.
Run the pipeline
Local development has no cron scheduler, so the page does the cron's work on demand: find the due sensors, write a job row for each one and put them on the queue.
No sensor is due: reading one moves its next read forward by its interval. Use Make every sensor due again to get work immediately.
Sensors
The rows the cron trigger selects from, with the due time it compares against.
No sensors. Apply the schema with npx wrangler d1 execute dotnet --local --file=migrations/0001_init.sql.
Latest readings
Written by the consumer once the rate gate let it through. 'simulated' means the weather API could not be reached, so the flow still produced a row.
No readings yet. Queue the due sensors above and the consumer will fill this table.
Jobs
One row per queued sensor, so the retry path is visible: attempts counts deliveries, last_error holds the reason.
No jobs yet.
Calls made from this page
No calls yet.