I am trying to determine the best way to do something for a project that I have, where I rely on an external API / service that takes ~ 2.5-4 seconds.
I am currently using javascript to load api / data after loading the DOM, and then jquery updates the partial on the page. Enough, since I have a bootloader, it still blocks the server process, so I would like to move it to a Heroku worker using delayed_job or something else? And the information from the API is user-specific, not what the cron job might be.
The data that I take out needs to be updated every few hours and written locally to the database, so I assume that the entire web socket, such as that provided by Pusherapp.com, will be redundant?
I tend to poll using delayed_job and expect a status update to determine its completeness. Has anyone done this with delayed_job? Tips or reservations?
thanks
source share