Changelog History
Page 1
-
v3.2.0 Changes
January 17, 2020โฑ Introduces scheduling an invocable with extra parameters.
โฑ See https://docs.coravel.net/Scheduler/#scheduling-tasks
-
v2.3.0 Changes
December 16, 2018๐ This release adds "sub-minute" task scheduling intervals:
EverySecond
EveryFiveSeconds
EveryTenSeconds
EveryFifteenSeconds
EveryThirtySeconds
-
v2.2.0 Changes
November 16, 2018โฑ Schedule Workers
-
v2.1.0 Changes
November 01, 2018Broadcast Events In Background Queue
Event broadcasting is great - but what if your event listeners are doing some heavy / long-winded tasks?
๐ฑ Using
QueueBroadcast
you can queue an event to be broadcasted in the background so your app can continue to be responsive.// This will broadcast the event whenever the queue is consummed in the background.this.\_queue.QueueBroadcast(new OrderCreated(orderId));
-
v2.0.0 Changes
October 03, 2018Major change:
- Coravel is .NET Standard compatible! Due to changes in dependencies etc. over the past weeks, Coravel is in a state where porting/migrating to .NET Standard makes sense.
๐ฑ The functionality is the same, yet allows using Coravel in shared libraries, "business layers", etc. E.g. Any .NET Standard 2.0 + lib ๐
-
v1.9 Changes
September 18, 2018โ Removed dependency on
Microsoft.AspNetCore.App
to use the respective "Abstraction" packages.
๐ฅ Breaking changes to how Coravel features are configured within theConfigure
method in Startup.cs (see docs)๐ Fixed some internal issues with the events system.
-
v1.8 Changes
September 10, 2018Overview Of Changes
- ๐ฆ Moved Mailer to own project / nuget package (Coravel.Mailer).
๐ฆ Coravel core package therefore has no more dependency on MailKit, among others. - Appropriate namespace changes made throughout code
- CLI command
event new
added - CLI text output changed to be more descriptive
- CLI coloured output added
- ๐ฆ Moved Mailer to own project / nuget package (Coravel.Mailer).
-
v1.7 Changes
September 04, 2018- ๐ New Feature "Events"
- โฑ Scheduled Task
When
method (contributed by @papakaliati) - ๐ Fixed issue with CLI on Unix machines
-
v1.6 Changes
August 28, 2018โฑ Scheduler Overhaul
โฑ The scheduler was the first Coravel feature - which was just a prototype built one day while I had some time to kill while my kids were asleep ;) I just wanted to see if it was possible for me to get a really basic version coded.
โฑ As the dotnet community has indicated there is some real interest in this project, the scheduler has naturally been due for a re-write - if it is to be used in actual projects.
โฑ Internal Scheduler Changes (Briefly)
- ๐ Internally - to decide whether a task was "due" - the time of a previously executed task was stored and then compared every 30 seconds against "Now" in order to see if the task should be executed again (yes - a naive implementation. This is why it needed a re-write!)
There are issues with this such as:- Initially, every task has to run at startup to get a value for the "previous executed time."
- Won't work when building a distributed scheduler (maybe a future feature)
- How do we handle intervals like "every month"? Once you restart or re-deploy your app the counter resets! So it's really "every month only if you haven't re-deployed for a month".
โ Unit Tests
โ These changes have also increased the number of unit tests in Coravel from over 100 to almost 600! Something that should help the community feel like Coravel is a reliable library to use.
Cron
โฑ Now the scheduler works like cron. Every minute the scheduled task checks the time and uses a cron expression to determine if it should run.
โฑ A side benefit is that we now have a
Cron
method available for scheduling tasks.I battled over whether or not to implement this myself. In the end, I decided that it was better not to add another dependency (especially since I couldn't find a library that was considered really trustworthy in this area).
I don't want to re-invent the wheel - I'm all for using third-party / NuGet packages others have made. But I want to ensure that whatever I do use has already been considered a trustworthy and reliable package (for example, I decided to include MailKit for the Mailer feature. MailKit is considered by everyone to be the .Net Core SMTP mailing go-to)
Threading Enhancements
โฑ The collection of scheduled tasks were simply held in a
List
. The scheduler allows scheduling tasks dynamically - while this isn't necessarily recommended (since these scheduled tasks will disappear after the application is closed) - it is possible. There may be some use-cases for this.โฑ Anyways, using a
List
in multi-threaded use cases is bad. So now the scheduler is using aConcurrentBag
(among other internal enhancements such as usingTask.WhenAll
, etc.).โฑ I'm still considering other parallel processing enhancements (to fire scheduled tasks in true parallel), but for now, the changes are needed and moving the right direction.
โฑ Schedule Configuration
โฑ Previously, all the scheduler config was done in
ConfigureServices
. This has changed to allow additional features and an implementation that uses .Net Core's DI container more properly.๐ง In
ConfigureServices
:services.AddScheduler()
๐ง Then in
Configure
- all the existing configuration methods can be used:app.UseScheduler(scheduler =\>{ scheduler.Schedule( () =\> Console.WriteLine("Every minute during the week.") ) .EveryMinute(); .Weekday(); });
๐ง Queue Configuration Changes
Just like the point above, the queue had the same changes made:
๐ง In
ConfigureServices
:services.AddQueue();
๐ง In
Configure
:app .ConfigureQueue() .OnError(e =\> { //.... handle the error });
Other New Features
Invocables
Coravel now exposes a concept of "Invocables". Basically, it's a class that can be "Invoked" (i.e. executed) asynchronously.
โฑ This allows us to create specific classes to do a certain "Job" in our system. These "jobs" can then be either scheduled or queued using a super simple syntax.
this.\_queue.QueueInvocable\<GrabDataFromApiAndPutInDBInvocable\>();// orscheduler .Schedule\<GrabDataFromApiAndPutInDBInvocable\>() .EveryTenMinutes();
Cli: Generate Invocable
๐ New command:
coravel invocable new [yourInvocable]
will generate a clean invocable all ready to go.Prevent Overlap
Sometimes you may have long running tasks (longer than 1 minute?). The normal behaviour of the scheduler is to simply fire off a task if it is due. What if you don't want a "due" task to execute if the previously executed one is still running?
scheduler .Schedule\<SomeInvocable\>() .EveryMinute() .PreventOverlapping("SomeInvocable");
- ๐ Internally - to decide whether a task was "due" - the time of a previously executed task was stored and then compared every 30 seconds against "Now" in order to see if the task should be executed again (yes - a naive implementation. This is why it needed a re-write!)
-
v1.5 Changes
August 03, 2018๐ This pre-prod release includes the Mailer and Cli features for their first appearance!