Zurück zum Ranking

Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!

dotnetcorebackground-jobsqueuemailinghacktoberfestdotnetscheduled-jobsdotnet-corebackground-threadbackground-worker
Sterne-Wachstum
Sterne
4.3k
Forks
270
Wochenwachstum
Issues
70
2k4k
Juni 2018Feb. 2021Nov. 2023Juli 2026
README

Netlify Status

Nuget NuGet

Coravel

Coravel helps developers get their .NET applications up and running fast by making advanced application features like task/job scheduling, queuing, caching, mailing (and more!) accessible and easy to use. Comes with simple, expressive and straightforward syntax.

You can view the official docs here.

Coravel Scheduler

Features:

Task/Job Scheduling

Usually, you have to configure a cron job or a task via Windows Task Scheduler to get a single or multiple re-occurring tasks to run.

With Coravel, you can setup all your scheduled tasks in one place using a simple, elegant, fluent syntax - in code!

Queuing

Coravel gives you a zero-configuration queue that runs in-memory to offload long-winded tasks to the background instead of making your users wait for their HTTP request to finish!

Caching

Coravel provides you with an easy to use API for caching in your .NET Core applications.

By default, it uses an in-memory cache, but also has database drivers for more robust scenarios!

Event Broadcasting

Coravel's event broadcasting helps you to build maintainable applications who's parts are loosely coupled!

Mailing

E-mails are not as easy as they should be. Luckily for you, Coravel solves this by offering:

  • Built-in e-mail friendly razor templates
  • Simple and flexible mailing API
  • Render your e-mails for visual testing
  • Drivers supporting SMTP, local log file or BYOM ("bring your own mailer") driver
  • Quick and simple configuration via appsettings.json
  • And more!

Samples

Support Me

You can support my ongoing open-source work on BuyMeACoffee.

Quick-Start

Here's how quickly you can use Coravel to begin building a basic worker service process that can issue actions at scheduled intervals:

  1. In terminal: dotnet new worker -n [NameOfYourApp] -o ./[NameOfYourApp]
  2. In terminal: dotnet add package coravel
  3. Replace Program.cs with the following:
using Coravel;

Console.OutputEncoding = System.Text.Encoding.UTF8;

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddScheduler();

var host = builder.Build();

host.Services.UseScheduler(s =>
{
    s.Schedule(() => Console.WriteLine("It's alive! 🧟")).EverySecond();
});

host.Run();
  1. In terminal: dotnet run

That's it - happy coding!

Coravel Pro

If you are building a .NET application with Entity Framework then you might want to look into Coravel Pro. It is an admin panel & tools to make maintaining and managing your .NET app a breeze!

  • Visual job scheduling & management
  • Scaffold a CRUD UI for managing your EF entities
  • Easily configure a dashboard to show health metrics (or whatever you want)
  • Build custom tabular reports of your data
  • And more!

FAQ

How is Coravel different from Hangfire?

Hangfire has been around for a while - before modern .NET (Core). It's a fantastic tool that has tons of features that Coravel doesn't. Notably: persistent queues, retry mechanisms, support for many storage drivers, etc.

However, Hangfire still (as of March 2023) does not natively support true async/await (here and here). This means that using Hangfire within a web application, for example, won't be as efficient as it could be when using threads that perform I/O operations.

Coravel was created with modern C# and .NET primitives in mind - such as async/await and .NET's built-in dependency injection utilities. This means that Coravel can be easier to configure and will be very efficient with / won't hog threads that your web application needs to respond to incoming HTTP requests.

How is Coravel different from Quartz?

Quartz is an older Java library ported to .NET. It still doesn't hook into the modern .NET dependency injection tooling well. Some think that Coravel's APIs are much more succinct and understandable.

For example, compare this sample from their documentation with how working with Coravel is (e.g. you don't need to understand how to "start" and "stop" Coravel's scheduler, but you do have to manually work with the Quartz scheduler).

Does Coravel support persisting queued jobs to storage in case my application goes down?

No. At least, not yet.

Coravel processes queued items in-memory. When your application goes down it won't allow the application to shutdown until all items are processed.

Does Coravel support retry mechanisms?

Coravel's philosophy has been to work well with other .NET primitives - which means that using other libraries is easy.

Coravel doesn't support retry mechanisms internally because I am very careful not to bloat Coravel with things that aren't necessary. I want to keep Coravel focused on what it does best (e.g. "I need job scheduling, queuing, etc. without requiring extra infrastructure and complicated configuration").

For example, you can use Polly within your invocables to do retries. Some people will configure a base class that inherits from IInvocable that has retries built-in.

Does Coravel support distributed locking?

No. However, this can again be achieved by using a battle-tested distributed locking library like DistributedLock. You might create an invocable's Invoke() like this:

public class TestInvocable : IInvocable
{
  private ApplicationDbContext _context;
  private IDistributedLockProvider _distributedlock;

  public TestInvocable(ApplicationDbContext context, IDistributedLockProvider distributedlock)
  {
    this._context = context;
    this._distributedlock = distributedlock;
  }

  public async Task Invoke()
  {
    await using (await this._distributedlock.AcquireAsync())
    {
      await this._context.Test.AddAsync(new TestModel() { Name = "test name" });
      await this._context.SaveChangesAsync();
    }
  }
}
Ähnliche Repositories
BeyondDimension/SteamTools

🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。

C#GNU General Public License v3.0steamcsharp
steampp.net
26.2k1.7k
icsharpcode/ILSpy

.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!

C#MIT Licensedecompilerdecompiler-engine
25.7k3.7k
dotnet/corefx

This repo is used for servicing PR's for .NET Core 2.1 and 3.1. Please visit us at https://github.com/dotnet/runtime

corefxcoreclr
docs.microsoft.com/dotnet/core/
17.5k4.8k
kgrzybek/modular-monolith-with-ddd

Full Modular Monolith application with Domain-Driven Design approach.

C#MIT Licensedddddd-architecture
13.9k2.2k
dotnet/coreclr

CoreCLR is the runtime for .NET Core. It includes the garbage collector, JIT compiler, primitive data types and low-level classes.

coreclrcorefx
docs.microsoft.com/dotnet/core/
12.8k2.6k
dotnet-architecture/eShopOnWeb

Sample ASP.NET Core 8.0 reference application, now community supported: https://github.com/NimblePros/eShopOnWeb

C#MIT Licenseasp-net-coreasp-net-core-mvc
10.7k6k
JeffreySu/WeiXinMPSDK

微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 10.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.

C#Apache License 2.0wechatwechat-sdk
weixin.senparc.com
8.9k4.3k
PixiEditor/PixiEditor

PixiEditor is a Universal Editor for all your 2D needs

C#GNU Lesser General Public License v3.0csharpraster-graphics
pixieditor.net
7.9k323
microsoft/botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.

JavaScriptnpmMIT Licensebotmicrosoft-bot-framework
7.8k2.4k
ElectronNET/Electron.NET

:electron: Build cross platform desktop apps with ASP.NET Core (Razor Pages, MVC, Blazor).

C#MIT Licenseelectrondotnet
gitter.im/ElectronNET/community
7.6k746
quartznet/quartznet

Quartz Enterprise Scheduler .NET

C#Apache License 2.0c-sharpdotnet
quartz-scheduler.net
7.1k1.7k
nissl-lab/npoi

a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.

C#Apache License 2.0excelbiff
nissl-lab.github.io/npoi/
6.2k1.5k