Fluent library that helps you out creating a schedule job process that runs multiple code blocks.
ScheduleJob scheduleJob = new ScheduleJobBuilder()
.WithWorkers(...)
.WithOptions(...)
.WithType(...)
.Build();
await scheduleJob.Run(cancellationToken);
Simple han?! ;)
.WithWorkers(...)
Collection of IWorker that contain the Work method which are invoked on that schedule job.
.WithOptions(...)
Passing the ScheduleJobOptions
class you can define the DelayTimeBetweenTasks
that states interval of time that each IWorker.Work(...)
will be invoked.
.WithCallback(...)
This is not implemented yet...
.WithType(...)
You can defined which type of schedule job is it(Hourly, Monthly,...) by using the ScheduleJobType
enum.
(Custom and a better implementation for this matter is under development).
Current options:
ScheduleJobType.Daily
ScheduleJobType.Hourly
ScheduleJobType.Weekly
ScheduleJobType.Montly
ScheduleJobType.Always
Simple.Schedule.Job library uses Tasks resources in order to reach a better performance and flexibility on your applications, thus, the CancellationToken
is crucial.
A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.
.Run(cancellationToken)
(A better implementation to use CancellationToken
is under development.)