Every 30 seconds within my application, I would like to make HTTP request to my second server. I would like to write the result into the database.
I am relatively new to Ruby and Rails, and I am not sure what is a standard way to accomplish this.
Should I use some kind or timer? Loop?
Should it be in model of my application? Or somewhere else?
Thank you in advance!
Here is a list of screencasts for running background jobs in rails. Once you’ve decided how you’re going to implement it, you can do everything you need to with the ruby standard library. Just use the http library.
You can write the results to a db like SQLite or whatever your application is using.