Releases: justdmitry/RecurrentTasks
v7.1: add net10
- New TargetFramework added:
net10.0
v7.0: net8.0 only, fully async
- New: TaskRunner does not create dedicated Task, instead it uses async/await (and ThreadPool), becoming more efficient;
- BREAKING: All previous framework support is dropped, only
net8.0is supported now; - BREAKING:
Start()now throwsInvalidOperationException(instead ofArgumentOutOfRangeException) whenOptions.FirstRunDelayis negative; - Fix: RunStatus.LastRunTime now updated even after failed run;
v6.6: net8.0
- New TargetFramework added:
net8.0. No any code changes, only framework reference. - Unsupported framework
net5.0removed from target networks. Ping me if you still need it.
v6.5
v6.4.1: Bugfix
Fixes bug reported in #12. Now setting values for Interval and FirstRunDelay greater than 24d 20H (int.MaxValue in milliseconds) will throw ArgumentOutOfRange exception.
v6.4: .NET 5.0
Library and test/samples now build for 3 frameworks: netstandard2.0, netcoreapp3.1 and net5.0
v6.3: NetCore 3.1
- Framework moniker
netcoreapp3.0updated tonetcoreapp3.1, now library supportsnetstandard2.0andnetcoreapp3.1 - Dependencies reorganized:
Microsoft.AspNetCore.Http.Abstractionsreplaced withMicrosoft.Extensions.DependencyInjection.Abstractions
v6.2: Multi-framework, less dependencies
Microsoft.Extensions.Optionsdependency removed- Library now built for both
netstandard2.0andnetcoreapp3.0framework monikers, with updated dependencies for last one.
v6.1: TRunnable can be an interface
Now you can call AddTask on interface (inherited from IRunnable) and register it's implementation later manually. This may be useful when you have several versions of same task and need to choose correct one on startup depending on configuration.
services.AddTask<IFileProcessorTask>(o => o.AutoStart(TimeSpan.FromMinutes(1)));
switch (configuration["FileProcessingMode"])
{
case "Network":
services.AddTransient<IFileProcessorTask, NetworkFileProcessorTask>();
break;
default:
services.AddTransient<IFileProcessorTask, LocalFileProcessorTask>();
break;
}v6.0: Big changes
1. IApplicationLifetime
Main reason of this version is IApplicationLifetime support (Issue #5) for better ASP.NET Core 2.1+ interaction. Now there is no more need for app.StartTask calls in your Startup.Configure - you need only services.AddTask<>(...) in Startup.ConfigureServices, and your task will be started/stopped automatically.
Doe to above, all configuration is moved to AddTask, so simplest task registration look like:
services.AddTask<SampleTask>(o => o.AutoStart(15)); // 15 min, TimeSpan also allowed
All additional configuration (Culture, FirstRunDelay, before/after handlers etc) should be done here. Please note slight property name changes.
2. ITask.Options
All configurable task options now available from ITask.Options property (e.g. for changing Interval from inside the task use currentTask.Options.Interval instead of currentTask.Interval) - that's breaking change you should pay attention to and update your tasks accordingly. Sorry.
3. ASP.NET Core 2.1 and netstandard2.0
As soon as IApplicationLifetime is supported only in ASP.NET Core 2.1 and above - depended libraries are upgraded to 2.1.0, and only netstandard2.0 target framework is supported (for netstartard1.0 and net46x use previous version).
4. Minor improvements
- [Issue #6]
ITasknow haveRunnableTyperead-only property, which returnstypeof(TRunnable). This may be used for logging purposes etc.