Using Hangfire as a WebJobs in process alternative

I have jobs that run continuously in Azure as WebJobs, but I would like to have the option to run them in process for development and non-azure installations of my app. Do you think that Hangfire would be suitable for starting my processes in a background thread and ensuring that they are constantly running? Any tips?

1 Like

I don’t like to give advice on abstract things and I can’t guarantee that Hangfire will fit your needs :smile: However if you want to see the ways to run your application for a long time without user requests, please see this topic.

I am aware of the appdomain idle issue and other issues. I am just wondering if hangfire is really meant to be used for a single long running process vs single background and scheduled background tasks. Basically, my process is just a loop listening for queue items and working on them. It’s really meant to be run as a service or a web job. But I want to have it run during development mode without having to startup and manage other processes. From what I am seeing in the docs, it doesn’t really seem like Hangfire is suitable to run a single process and make sure that it continues running. It seems like it’s meant to process individual queue items or single background tasks. Am I understanding it correctly?

Yep, Hangfire is intended to run individual background tasks and not continuously running processes. So, it will be useful only if you can convert your queue items into background jobs.