-1

I would like to enqueue Hangfire jobs from a WPF desktop application. Is this possible?

I currently have an api that talks to our Hangfire server but would like to bypass it to enqueue background jobs directly. Has anyone set this up before? I'm not seeing any examples online.

foldinglettuce
  • 522
  • 10
  • 28
  • 1
    From [the docs](https://docs.hangfire.io/en/latest/) *Hangfire is not tied to the specific .NET application type. You can use it in ASP.NET web applications, non-ASP.NET web applications, in console applications or Windows services.* - I do not see any point why you can not use it within WPF - But maybe it is not a wise choice to do so, as the jobs are only executed as long as the app is running. If that is fine for you, just do it – Sir Rufo Aug 01 '23 at 06:16
  • 1
    @SirRufo maybe I worded it poorly. My intent is to off load work from the desktop app to the hangfire server. In other words, send jobs from desktop to the server. My googling returned was examples of setting up the hangfire server. It was pretty sparse on details of sending jobs to the server. *shrug* I'll keep searching I guess. Thanks for the reply – foldinglettuce Aug 08 '23 at 19:13

1 Answers1

1

I think you are after BackgroundJob.Enqueue()

https://docs.hangfire.io/en/latest/background-methods/calling-methods-in-background.html

SSS
  • 4,807
  • 1
  • 23
  • 44