Madjic.Tasks.Orchestration 2.0.0-rc

This is a prerelease version of Madjic.Tasks.Orchestration.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Madjic.Tasks.Orchestration --version 2.0.0-rc
NuGet\Install-Package Madjic.Tasks.Orchestration -Version 2.0.0-rc
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Madjic.Tasks.Orchestration" Version="2.0.0-rc" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Madjic.Tasks.Orchestration --version 2.0.0-rc
#r "nuget: Madjic.Tasks.Orchestration, 2.0.0-rc"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Madjic.Tasks.Orchestration as a Cake Addin
#addin nuget:?package=Madjic.Tasks.Orchestration&version=2.0.0-rc&prerelease

// Install Madjic.Tasks.Orchestration as a Cake Tool
#tool nuget:?package=Madjic.Tasks.Orchestration&version=2.0.0-rc&prerelease

Madjic.Tasks.Orchestration

This library allows tasks to be executed as any dependent tasks are completed. It is loosely based on an article published by MSDN Magazine at learn.microsoft.com.

There are two methods that can be used. The first uses a manager class to add individual operations and then call a separate method to execute them. You must add the operations without any dependencies first. Then, you can add operations that depend on the previously added operations. This forces the internal graph of operations to be acyclic. This is more of bottom-up approach. You then call a method to execute all of the operations using async/await.

The second method is more object oriented. You define classes that inherit from Operation. Then, you can create instances of these derived classes and manually add the dependencies. This is a top-down approach. To execute the operations, you use a static method on the Operation class itself. Since this method potentially lets you add operations that create cycles, it will throw an exception if it detects one before it executes any of the operations.

The motivation for this library was a need to fetch data from an external source, perform some transformations on it, bring it into our database, and then perform some analysis on the data as early as possible in the job. I wanted to keep our network and database activity saturated as much as possible to reduce the overall time to complete the job.

Version 2.0.0

The library has been updated to allow Operation instances to accept a TaskPool owner. This allows an operation to not only be dependent on other operations completing, but also limiting the number of operations that can be executing in an individual TaskPool. This is useful to ensure that you don't over saturate a resource, such as a database or external web API service. This does not use the System.Threading.RateLimiting NuGet package but is similar in concept.

A bug was fixed where it was possible to add a perfect circular dependency that was not caught since the first piece of code was to generate a list of operations by only looking at operations without dependencies. If there weren't any, the method assumed there were no operations and returned without doing any work. Now, it will throw the same exception as when cycles are detected.

Version 2.0.0 Breaking Changes

The ExecuteAll method has been renamed to ExecuteAllAsync. This is to follow the convention of naming async methods.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.1 128 9/21/2023
2.0.0-rc 90 9/11/2023
1.0.0 136 8/21/2023