Advice: serialised processing

I would like to serialise processing of a domain specific task in my application. I’m wondering if Hangfire would be suitable for my scenario. I have looked for some precedent in the documentation and the forums but haven’t found anything so far. My apologies if it’s been covered already :blush:

Serialised processing scenario
To avoid using any terminology that is specific to Hangfire, let’s call my domain specific task x

  • x can be started during any lifecycle request. However, it is important, no matter how many times a request for starting x is issued, that x never runs in parallel
  • I am not running in a web farm scenario so no need to co-ordinate serialisation of x across machine boundaries
  • x is idempotent
  • x can recover from machine failure itself so there is no need to use Hangfire for resumption or anything like that
  • x can resume itself from whenever it last ran so doesn’t need run all the time
  • Repeatedly enqueuing x is not a problem as long is the queue is processed serially
  • x doesn’t require any input or output parameters

I want to reduce latency for my users and therefore want to keep x in-process with the app. Hence I’m considering Hangfire. Hopefully someone can give me some pointers/advice! :smile: