Giter Site home page Giter Site logo

hangfire's Introduction

HangFire

HangFire gives you a simple way to kick off long-running processes from the ASP.NET request processing pipeline. Asynchronous, transparent, reliable, efficient processing. No Windows service/ Task Scheduler required. Even ASP.NET is not required.

Improve the responsiveness of your web application. Do not force your users to wait when the application performs the following tasks:

  • mass notifications/newsletter;
  • batch import from xml, csv, json;
  • creation of archives;
  • firing off web hooks;
  • deleting users;
  • building different graphs;
  • image processing;
  • …and so on.

Just wrap your long-running process to a method and instruct HangFire to create a background job based on this method. All backround jobs are being saved to a persistent storage (Redis, SQL Server or SQL Server + MSMQ) and performed on a dedicated worker thread in a reliable way inside or outside of your ASP.NET application.

HangFire is a .NET Framework alternative to Resque, Sidekiq, delayed_job.

HangFire Dashboard

Installation

See the Quick start guide to learn how to install and use HangFire for the first time.

HangFire is available as a NuGet package. So, install it using the NuGet Package Console window:

PM> Install-Package HangFire

After installing, open the ~/App_Start/HangFireConfig.cs file and modify the connection string:

JobStorage.Current = new SqlServerStorage(
    @"Server=.\sqlexpress; Database=MyDatabase; Trusted_Connection=True;");

Usage

1. Enqueue a background job

You can run in background regular static or instance methods, just do the following:

BackgroundJob.Enqueue(() => Console.WriteLine("Hello, world!"));

2. Process it in background

Processing is made inside a different worker thread. To start the worker pool, call:

var server = new AspNetBackgroundJobServer();
server.Start();

Please note, that these lines already added in the ~/App_Start/HangFireConfig.cs file for you.

This is incomplete list of features, to see all of them, check the official site and the documentation.

Questions? Problems?

Open-source project are developing more smoothly, when all discussions are held in public.

If you have any questions, problems related to the HangFire usage or want to discuss new features, please visit the discussion forum. You can sign in there using your existing Google or GitHub account, so it's very simple to start using it.

If you've discovered a bug, please report it to the HangFire GitHub Issues. Detailed reports with stack traces, actual and expected behavours are welcome.

Related Projects

Roadmap

  • Full documentation for product and its API.
  • More tutorials and articles that describe the features and use cases.
  • Recurring jobs support to fully cover all background needs.
  • Support for other job storages, including Microsoft Azure Storage.
  • Make it easier to maintain jobs, even on large-scale systems.
  • Deliver the solution to the 90% of ASP.NET developers πŸ˜„.

License

Copyright Β© 2013-2014 Sergey Odinokov.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

githalytics.com alpha

hangfire's People

Contributors

odinserj avatar hahmed avatar devmondo avatar

Watchers

Sudhakar Dasoju avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.