Introduction to crumble 60% done
Crumble is an elegant abstraction for even-driven jobs. It helps you define event-driven or time-based jobs that are simple to use in your distributed system, as serverless functions, or as background workers in a monolith application. The abstraction allows a simple swap at any time, and it natively integrates with the 2S platform.
TIP
It is based on source generators and uses no reflection, which makes it extremely fast and robust. It is going to be an abstraction for Azure Functions, TickerQ, and Orleans. The current focus is to polish the solution for Orleans.
The main idea is to bring together a proper event-driven approach, serverless principles, and your current application architecture. Abstract it from a concrete framework or cloud platform, and make it easily accessible from any place of .net platform, as a standalone application, distributed system, or Azure native serverless compute services, the Azure Functions.
Getting started
- Create a project for your jobs.
- Add a reference to the desired source generator.
dotnet add package 42.Crumble.SourceGenerator.<architecture>- Implement jobs.
[Crumb, TimeEvent("42 */1 * * *")]
public async Task DoWork()
{
await Task.Delay(1000);
}- Reference the crumble runtime with your application.
dotnet add package 42.Crumble.Runtime.<architecture>- Reference and register jobs with your application.
public void EntryPoint(IHostApplicationBuilder builder)
{
builder.Services.AddCrumble().AddCrumbs();
}
42for.net