Polling
Polling is executing a periodic action checking for a state change. Examples are pinging a host, calling a REST API, or listing an Amazon S3 bucket for newly uploaded files.
Cadence support for long running activities and unlimited retries makes it a good fit.
Samples
Runnable samples covering the building blocks of polling:
| Sample | Description | Code |
|---|---|---|
| Activity retry with heartbeat | Long-running activity that heartbeats progress and retries without limit | Go · Java |
| Durable timer | Fires a durable timer to take action when an operation runs too long | Go |
Some real-world use cases:
- Network, host and service monitoring
- Processing files uploaded to FTP or S3
- Cadence Polling Cookbook by Instaclustr: Polling an external API for a specific resource to become available