what do you think it is the most efficient way to fire a call back every n-seconds?
I am running some async computation in the backend and saving the results, and I would like the call back from time to time to check if the results is computed and render some message to the browser.
I am trying to do some async work (for example sending emails). My hosting provider does not support thread or other similar lib, but it does allow to set some “always-on-task”, so I create a csv file (or database it is the same) with a queue of async jobs to be done with info on the job status (pending, processing, done). the always-on-task run the jobs one by one from eat queue. I want to render at screen if a specific job is done, thus the need to check every n-second the csv file to check the job status.
so in my small example the “do some stuff” would be for example reading the latest info from a csv file.