zlacker

[parent] [thread] 1 comments
1. abelan+(OP)[view] [source] 2024-03-08 22:13:29
It wouldn't be suitable for that at the moment, but might be after some refactors coming this weekend. I wrote a very quick scheduling API which pushes schedules as workflow triggers, but it's only supported on the Go SDK. It also is CPU-intensive at thousands of schedules, as the schedules are run as separate goroutines (on a dedicated `ticker` service) - I'm not proud of this. This was a pattern that made sense for the cron schedule and I just adapted it for the one-time scheduling.

Looking ahead (and back) in the database and placing an exclusive lock on the schedule is the way to do this. You basically guarantee scheduling at +/- the polling interval if your service goes down while maintaining the lock. This allows you to horizontally scale the `tickers` which are polling for the schedules.

replies(1): >>moribv+U5
2. moribv+U5[view] [source] 2024-03-08 22:57:05
>>abelan+(OP)
Thanks for the follow-up! I’ll keep an eye on the progress.
[go to top]