Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created April 26, 2016 02:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dcomartin/abf79beedbe2aec2b10dc6cd9ed9ced6 to your computer and use it in GitHub Desktop.
using System;
namespace Hangfire.Demo
{
class Program
{
static void Main(string[] args)
{
GlobalConfiguration.Configuration
.UseColouredConsoleLogProvider()
.UseSqlServerStorage("MyHangfireConnection");
using (var server = new BackgroundJobServer())
{
BackgroundJob.Enqueue(() => Console.WriteLine("Hello, world!"));
Console.WriteLine("Hangfire Server started. Press any key to exit...");
Console.ReadKey();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment