Atya.Application.Idempotency 1.0.0

Prefix Reserved
dotnet add package Atya.Application.Idempotency --version 1.0.0
                    
NuGet\Install-Package Atya.Application.Idempotency -Version 1.0.0
                    
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="Atya.Application.Idempotency" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Atya.Application.Idempotency" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Atya.Application.Idempotency" />
                    
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 Atya.Application.Idempotency --version 1.0.0
                    
#r "nuget: Atya.Application.Idempotency, 1.0.0"
                    
#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 Atya.Application.Idempotency@1.0.0
                    
#: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=Atya.Application.Idempotency&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Atya.Application.Idempotency&version=1.0.0
                    
Install as a Cake Tool

Atya.Application.Idempotency

Idempotency primitives for safely handling repeated application operations.

Installation

dotnet add package Atya.Application.Idempotency

Quick Start

using Atya.Application.Idempotency;
using Atya.Foundation.Results;
using Atya.Foundation.Time;

Result<IdempotencyKey> key = IdempotencyKey.Create("orders:create:42");
if (key.IsFailure)
{
    return key.Error.Message;
}

IClock clock = new SystemClock();
var store = new InMemoryIdempotencyStore();
var executor = new IdempotentExecutor(store, clock);

Result<string> replayed = await executor.ExecuteAsync(
    key.Value,
    TimeSpan.FromMinutes(10),
    _ => ValueTask.FromResult(Result.Success("order-42")),
    cancellationToken);

return replayed.Match(value => value, error => error.Message);

Feature Tour

  • IdempotencyKey validates caller-provided keys and offers a Result-returning Create method for request input.
  • IdempotencyLease computes and evaluates UTC replay windows with Atya.Foundation.Time.IClock.
  • IIdempotencyStore atomically begins keys and stores completed results.
  • InMemoryIdempotencyStore provides a thread-safe proving implementation for tests, samples, and simple hosts.
  • IdempotentExecutor runs the begin → execute → complete → replay flow for Result<T> operations.
  • IdempotencyReplay<T> replays a stored Result<T> until its lease expires.
  • IdempotencyErrors exposes stable error codes for duplicate in-progress and expired idempotency states.

Error Codes

Code Kind When
atya.application.idempotency.key_required Validation Caller input did not contain a usable idempotency key.
atya.application.idempotency.in_progress Conflict A matching key already has an operation in progress.
atya.application.idempotency.expired Conflict A matching idempotency record exists but is no longer valid for replay.

Why These Dependencies

Dependency Purpose
Atya.Foundation.Guards Programmer-error guards for public constructors and methods.
Atya.Foundation.Results Expected validation, duplicate, and expired outcomes.
Atya.Foundation.Time UTC-safe expiration checks through IClock and TimeGuard.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 113 7/13/2026