Add option to immediately start a submitted job

Tags: #<Tag:0x00007f281adb9ae0>


We’re using sql server for the job queue. We’re using hangfire in order to be able to return to our (rest) caller immediately so as not to block them, and be sure the job will run. The job completion depends on what may be either short or long-running downstream work in other servers. If that downstream work is not complete in a reasonable amount of time, we end the current job by a timeout on the downstream server(s), and resubmit our job to try again in several minutes or hours. Works great. Kudos to the Hangfire team.

However, the time of the first invoke of the job depends on the polling interval, so if we just miss a poll, then we have to wait quite a while (several seconds) before the job will start. If the downstream work is the kind that runs quickly, then the initial poll time is much longer than the job itself.

This request is to provide an option to start the job immediately on first submission, rather than the next poll, to avoid this “first time startup” delay.


Seconded. It would be also nice to know if the polling span is fixed or if polling is instant as long as the processor keeps finding work to do?

For example, it polls every X interval. Once it finds something on the next poll event, processes the item(s), then immediately polls for more work, or does it wait for the next polling interval?

If we could get the former such that polling intervals occur only when no work is found on the last polling event, we could feel more comfortable about increasing that polling interval.