Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Task Turnstile
[![NuGet](https://img.shields.io/nuget/dt/taskter.svg)](https://www.nuget.org/packages/clevercache)
[![NuGet](https://img.shields.io/nuget/vpre/clevercache.svg)](https://www.nuget.org/packages/clevercache)

A thread-safe named task lifecycle manager for .NET. Prevents duplicate background job execution across threads and — optionally — across multiple application instances via a distributed backing store.

Expand Down Expand Up @@ -50,10 +52,7 @@ builder.Services.AddTaskTurnstile()
});
```

> **Note:** The cache table must be created before first use:
> ```
> dotnet sql-cache create "Server=.;Database=MyApp;..." dbo ActiveTasks
> ```
> The table is created automatically on first startup — no manual setup required.

### Use the app's existing `IDistributedCache`

Expand All @@ -68,6 +67,10 @@ Task keys are prefixed with `KeyPrefix` (default `"cm:"`) to avoid collisions wi

---

> **Performance:** Regardless of which backing store you choose, all state checks are short-circuited by a local in-process memory cache. Once this instance marks a task as running, subsequent checks skip the backing store entirely until the task stops or its `maxRuntime` expires.

---

## Options

```csharp
Expand Down
1 change: 1 addition & 0 deletions TaskTurnstile.Redis/TaskTurnstile.Redis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</Description>
<PackageTags>Concurrency, Background Tasks, Named Lock, Redis, Distributed Cache</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/chunty/TaskControlTower</PackageProjectUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class TaskTurnstileBuilderExtensions
/// <summary>
/// Uses a dedicated SQL Server distributed cache as the backing store, isolated from any
/// other distributed cache the app may have registered.
/// The cache table must exist — create it with: dotnet sql-cache create "connection" schema table
/// The cache table is created automatically on first startup if it does not already exist.
/// </summary>
/// <example>
/// services.AddTaskTurnstile()
Expand Down
3 changes: 2 additions & 1 deletion TaskTurnstile.SqlServer/TaskTurnstile.SqlServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<Description>
SQL Server backing store for TaskTurnstile via IDistributedCache.
Supports dedicated SQL Server instances independent of the app's own cache.
Requires the cache table to be pre-created with the dotnet sql-cache CLI tool.
The cache table is created automatically on first startup.
</Description>
<PackageTags>Concurrency, Background Tasks, Named Lock, SQL Server, Distributed Cache</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/chunty/TaskControlTower</PackageProjectUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 1 addition & 5 deletions TaskTurnstile/TaskTurnstile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@
</Description>
<PackageTags>Concurrency, Background Tasks, Named Lock, Task Manager, Distributed Cache, Job Guard</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/chunty/TaskControlTower</PackageProjectUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="TaskTurnstile.Tests" />
</ItemGroup>
Expand Down
Loading