Reputation: 21
I want to implement a delay task and found a cadence cron example, how to use cadence to implement a delay task?
Upvotes: 1
Views: 637
Reputation: 196
Cadence supports both activity and workflow delaying.
Activity delay can be achieved with Workflow.Sleep API
Workflow delay can be achieved with DelayStart option. See https://github.com/uber-go/cadence-client/blob/e66e2d4da8def80e7a5730b824a2de7a28f5c050/internal/client.go#L415
Upvotes: 1
Reputation: 6890
Cron is for periodic execution of some functionality.
If you need to delay a task you can call sleep
and the beginning of the workflow and then call an activity that executes the task.
Upvotes: 2