I have a table of schedule items, they may be scheduled for the same time. I’m wondering how to have them all execute at the correct time when:
The problem I see is that executing one scheduled item (like a scheduled twitter post) requires an API request which may take up to a second or two – probably longer. If I execute them sequentially + there are too many scheduled items at the same time, the time they get executed at could be after the scheduled time.
How would I go about building this “scheduling” system that avoids these problems? Any tips, advice?
Thanks!
I would use a Windows service to accomplish this. Then each of the items should be scheduled asynchronously using the BackgroundWorker process. This would allow all of the scheduled processes to be launched rapidly asynchronously so they don’t collide and aren’t depending on the previous one finishing before kicking off.