Reputation: 14418
I am trying to write a very simple rails backend backed up with a mysql database. It's very simple, I have two tables, one is the users table, tweets table, and a time for each tweet. Basically besides just an API, I would like to write a scheduler for posting the tweets at a specific time in the database. This is what confuses me.. how do I write a loop in the background that always checks the current time if there's any tweet that needs to be posted?
Any recommendation/guidelines in achieving this would be helpful.
Upvotes: 1
Views: 155
Reputation: 9738
You need a background job management.
Periodically, you will check if there is anything to do and eventually do it.
Please check this relevant SO question.
Here are some other pointers:
Upvotes: 1