My application need continous fetching of data from Twitter. I used twitter gem to access Twitter API. Have used #rufus-scheduler to hit the Twitter API after every half an hour, but it is not working, as some time it is blocked by the Twitter API for increasing limit.
Asked
Active
Viewed 402 times
1 Answers
1
I have already answered to a similar question here Background task
Basically, if you want to periodically fetch something on the Twitter API, you can use a cron job, but if you want to do it in real time, consider using a background job.
Example
while true
if thereIsSomethingToDo
# Do something here...
else
sleep 60 # Could be + or -
end
end
There is different ways to manage background jobs. Here is one: