Incursa.Platform.Idempotency
6.0.4
Prefix Reserved
dotnet add package Incursa.Platform.Idempotency --version 6.0.4
NuGet\Install-Package Incursa.Platform.Idempotency -Version 6.0.4
<PackageReference Include="Incursa.Platform.Idempotency" Version="6.0.4" />
<PackageVersion Include="Incursa.Platform.Idempotency" Version="6.0.4" />
<PackageReference Include="Incursa.Platform.Idempotency" />
paket add Incursa.Platform.Idempotency --version 6.0.4
#r "nuget: Incursa.Platform.Idempotency, 6.0.4"
#:package Incursa.Platform.Idempotency@6.0.4
#addin nuget:?package=Incursa.Platform.Idempotency&version=6.0.4
#tool nuget:?package=Incursa.Platform.Idempotency&version=6.0.4
Idempotency
Incursa.Platform.Idempotency provides a small abstraction for tracking idempotency keys across retries and workers.
Core abstraction
IIdempotencyStoremanages the lifecycle of an idempotency key.IIdempotencyStoreProviderandIIdempotencyStoreRouterhelp resolve stores in multi-database setups.
Typical flow
- Call
TryBeginAsyncwith a stable idempotency key. - If it returns
true, perform the work. - Call
CompleteAsyncwhen the operation is finished. - Call
FailAsyncwhen the operation should be retried later.
Usage
public sealed class ChargeProcessor
{
private readonly IIdempotencyStore store;
public ChargeProcessor(IIdempotencyStore store)
{
this.store = store;
}
public async Task<bool> ProcessAsync(string idempotencyKey, CancellationToken cancellationToken)
{
if (!await store.TryBeginAsync(idempotencyKey, cancellationToken))
{
return false;
}
try
{
// perform external call
await store.CompleteAsync(idempotencyKey, cancellationToken);
return true;
}
catch
{
await store.FailAsync(idempotencyKey, cancellationToken);
throw;
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Incursa.Platform.Idempotency:
| Package | Downloads |
|---|---|
|
Incursa.Platform.ExactlyOnce
Exactly-once orchestration primitives built on idempotency and verification hooks. |
|
|
Incursa.Platform.SqlServer
SQL Server provider for Incursa Platform outbox, inbox, scheduler, fanout, metrics, and leases. |
|
|
Incursa.Platform.Postgres
PostgreSQL provider for Incursa Platform outbox, inbox, scheduler, fanout, metrics, and leases. |
|
|
Incursa.Platform.InMemory
In-memory provider for Incursa Platform primitives for testing and local development. |
|
|
Incursa.Platform.Email
Outbox-driven email delivery primitives, policies, and provider abstractions for Incursa Platform. |
GitHub repositories
This package is not used by any popular GitHub repositories.