Archive for the ‘HangFire’ Category

HangFire and ASP.NET MVC

February 2, 2016

Hello,

In this post I will talk about how I used HangFire in an ASP.NET MVC application.

First of all, what is HangFire? HangFire is a tool that is used to perform recurring tasks inside ASP.NET applications. It uses a persistant storage behind the scenes (i.e.: like SQL Server) that is used to store the jobs that can be later on retrieved and re-run in case some of them fails to run to completion.

The code below illustrates how I created a job that sends emails with CSV attachments every day at 8 AM.

hangfire_code_snippet

This tool also has a console that can be accessed locally only (for security purposes) and it looks like the image below:

hangfire

From the console one can see all the recurring jobs that are available and can trigger any of them at any time.

hangfire_recurring_jobs

More information can be found at this url:  About HangFire