jobbrIO / jobbr-server

Jobbr is a non-invasive .NET JobServer
https://jobbr.readthedocs.io
GNU General Public License v3.0
50 stars 5 forks source link

Jobbr Build status

Jobbr is a .NET job server. It is designed to reduce artifical complexity when a job server is needed in a project. Jobbr tries to get out of your way as much as possible so that you can focus on business logic. Job implementations have no dependency to Jobbr which makes it easy to integrate Jobbr in any .NET project.

Master build status NuGet-Stable
Develop build status NuGet Pre-Release

Main Features

QuickStart

The best way to get started is to check out the demo repo to see a running example of Jobbr.

Implementing a job

Good news! All your C#-Code is compatible with jobbr as long as the CLR-type can be instantiated and has at least a public Run()- Method.

public class SampleJob
{
    public void Run()
    {
        const int iterations = 15;

        for (var i = 0; i < iterations; i++)
        {
            Thread.Sleep(500);

            Console.WriteLine("##jobbr[progress percent='{0:0.00}']", (double)(i + 1) / iterations * 100); // optional: report progress
        }
    }
}

Configuring job with triggers

To define jobs use the AddJobs extension method:

jobbrBuilder.AddJobs(repo =>
{
    // define one job with two triggers
    repo.Define("SampleJob", "Quickstart.SampleJob")
        .WithTrigger(DateTime.UtcNow.AddHours(2)) /* run once in two hours */
        .WithTrigger("* * * * *"); /* run every minute */
});

If you need to add triggers at runtime head over to the REST API component which also includes a typed client. The REST API is optional and has to be plugged in if needed.

Persistence

There are two different storages:

By default Jobbr runs in memory, thus all data is lost when Jobbr is restarted. To keep the data configure one of the storage providers:

Storage

ArtefactStorage

License

This software is licenced under GPLv3. See LICENSE, please see the related licences of 3rd party libraries below.

Acknowledgements

Jobbr Server is based on following great open source projects:

Credits

This application was built by the following awesome developers: