When I use the code below, is the task queued for execution at the Hangfire server Or it is executed immediately?
I am still trying to understand how Hangfire works for fire-and-forget tasks.
BackgroundJob.Enqueue(() => DosomeLongTask());
When I use the code below, is the task queued for execution at the Hangfire server Or it is executed immediately?
I am still trying to understand how Hangfire works for fire-and-forget tasks.
BackgroundJob.Enqueue(() => DosomeLongTask());
I found the answer. Its going to be queued. Everything in Hangfire gets queued.
So, it may or may not execute immediately depending on how many requests are waiting in the queue from before.
Sorry for the delay. Yep, all jobs are being executed outside of the request processing pipeline. You can also lower the processing latency by using Hangfire.SqlServer.MSMQ
or Hangfire.Redis
packages.