TaskGate.Core 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package TaskGate.Core --version 1.0.1
                    
NuGet\Install-Package TaskGate.Core -Version 1.0.1
                    
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="TaskGate.Core" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TaskGate.Core" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="TaskGate.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TaskGate.Core --version 1.0.1
                    
#r "nuget: TaskGate.Core, 1.0.1"
                    
#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.
#:package TaskGate.Core@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TaskGate.Core&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=TaskGate.Core&version=1.0.1
                    
Install as a Cake Tool

TaskGate

TaskGate is a database-backed execution framework for high-volume job queues that keeps .NET workloads resilient, coordinated, and observable. It helps you orchestrate parallel processing while retaining strict control over resource usage.

Highlights

  • Configurable parallelism and queue thresholds
  • Robust retry and timeout policies
  • Extensible provider model for multiple data stores
  • Isolated DbContext management to avoid cross-task interference

Installation

# Core building blocks
 dotnet add package TaskGate.Core

# Oracle provider
 dotnet add package TaskGate.Oracle

# SQL Server provider
 dotnet add package TaskGate.SqlServer

Quick Start

var builder = WebApplication.CreateBuilder(args);
var services = builder.Services;

services.AddOracleTaskGate<MyAppContext>(
    connectionString: builder.Configuration.GetConnectionString("TaskGate"),
    options =>
    {
        options.MaxParallelism = 8;
        options.MaxQueueSize = 500;
        options.TaskTimeout = TimeSpan.FromMinutes(5);
    });

var app = builder.Build();
app.Run();

Usage

Simple usage

  1. Model a work item (SampleTask) that represents the payload you want to process.
  2. Register TaskGate services in your DI container and inject ITaskGateRuntime<TContext> where you will orchestrate jobs.
  3. Run a batch by passing tasks and a lightweight handler that receives the scoped DbContext, any shared HTTP services, and the current task. The following example shows how TaskGate scopes each execution with a DbContext and lets you compose data access alongside custom logic:
internal class ExampleClass
{
    private readonly ITaskGateRuntime<SampleDbContext> _taskGate;

    public ExampleClass(ITaskGateRuntime<SampleDbContext> taskGate)
    {
        _taskGate = taskGate;
    }

    public async Task SampleMethod(CancellationToken ct)
    {
        var taskList = Enumerable.Range(1, 5)
                             .Select(x => new SampleTask { Id = x })
                             .ToList();

        await _taskGate.Run(
            taskList,
            async (db, http, task, token) =>
            {
                Console.WriteLine($"Task {task.Id} - DbContext Hash: {db.GetHashCode()}");

                var companies = await db.Company
                    .AsNoTracking()
                    .Take(10)
                    .ToListAsync(token);

                Console.WriteLine($"Task {task.Id} → {companies.Count}");
            },
            ct
        );
    }
}

Architecture Snapshot

TaskGate centralizes queueing, leasing, and concurrency coordination in the TaskGate.Core package. Provider packages (Oracle, SQL Server) deliver data-source specific infrastructure while sharing the same leasing and retry primitives. Applications opt into the provider they need and compose TaskGate services through familiar dependency injection patterns.

Provider Layout

  • TaskGate.Core – contracts, queue orchestration, concurrency limits, retry policies
  • TaskGate.Oracle – Oracle provider implementation and specialized TaskGateRetryPolicy
  • TaskGate.SqlServer – SQL Server provider implementation with pooled leasing integration
  • Extend the abstractions in TaskGate.Core to add your own provider and wire up database operations.

Example Scenario

A finance platform processes 10,000 invoice tasks in parallel without compromising isolation: every task uses its own DbContext so state remains consistent. If the API tier crashes, TaskGate keeps the pending queue in durable storage and resumes processing when services recover. Combined retry, timeout, and concurrency limits smooth out transient issues while protecting downstream dependencies.

License

MIT

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on TaskGate.Core:

Package Downloads
TaskGate.Oracle

Oracle provider integration for TaskGate parallel execution runtime.

TaskGate.SqlServer

SQL Server provider integration for TaskGate parallel execution runtime.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 198 11/7/2025
1.0.2 190 11/7/2025
1.0.1 192 11/7/2025
1.0.0 216 11/7/2025