Hangfire methods that dequeue and process requests

I was wondering what modules of the Hangfire.Core or Hangfire.SqlServer is in charge of dequeing an enqueued job and processing it? And can we custom these methods?

@Jiarui_Hou, Hangfire.Core contains all the types and methods Hangfire brings, with abstracted job storage. Hangfire.SqlServer contain storage implementation related to SQL Server. But I don’t understand, what do you want to achieve. Can you detail your questions?

What I mean is that I’d like to have the capabilities of customizing Hangfire library methods if possible. For example, alter the built-in timer duration, so it dequeues jobs more or less frequently.

Hangfire is customizable a lot, but this concept is not well documented yet :wink: If you like to read the source code, you’ll receive the following ways to customize it:

  • Add code before and after creating a background job (through client filters).
  • Add code actions before and after performing a background job (through server filters). Please see CaptureCultureAttribute for example.
  • Modify the state change pipeline, including introducing the new states (through state filters and custom states). See AutomaticRetryAttribute and QueueAttribute for examples.
  • You can use extensible job storage to persist your own data.
  • You can add new pages to the Hangfire dashboard (in 1.4 it will be possible to alter the dashboard menu either).
  • You can add support for your own storage.
  • Maybe other things I’ve missed

As you can see, there are a lot of work for the documentation :smile:

Would you mind elaborating little on introducing new states. My jobs can take a long time to cancel and I would like a Cancelling state…