Pocok.Readiness 0.2.0-alpha.7

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

Pocok.Readiness

Pocok.Readiness separates actual readiness from the fact that a lifecycle method was scheduled. It provides a thread-safe, restartable readiness source for hosted services, caches, adapters, and integration runtimes.

Compatibility tier: releasable alpha. Publication remains tag-driven and subject to the repository release gates.

var readiness = new ReadinessSource();
var cycle = readiness.BeginStartup();

try
{
    await InitializeAsync(cancellationToken);
    readiness.MarkReady(cycle);
}
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
{
    readiness.CancelStartup(cycle, cancellationToken);
    throw;
}
catch (Exception exception)
{
    readiness.MarkFailed(
        cycle,
        ReadinessFailure.FromException("cache.start.failed", "The cache could not start.", exception));
    throw;
}

await readiness.WaitUntilReadyAsync(cancellationToken);

Lifecycle contract

  • A source begins in Stopped; waiters then observe the next startup cycle.
  • BeginStartup is valid from Stopped or Failed and returns an opaque cycle token.
  • Only the active cycle can become ready, fail, or be cancelled. A stale or foreign token is rejected.
  • A successful MarkReady releases all waiters. Continuations are scheduled asynchronously.
  • Failure faults waiters with ReadinessFailedException and preserves a caller-safe ReadinessFailure.
  • Startup cancellation cancels current waiters with the supplied cancelled token and remains distinct from failure.
  • BeginShutdown removes readiness immediately. Waiters from an interrupted startup receive ReadinessStoppedException; new waiters observe a later restart.
  • Shutdown failure remains observable until a new startup begins.

The source does not own a timeout policy. A caller may cancel its own wait or use Task.WaitAsync; neither action changes shared readiness and a timeout is never treated as success.

All state transitions are thread-safe. The source contains no ambient state, logging, dependency injection, or process-global registration. Dispose values attached to a ReadinessFailure according to their own ownership contract; this package does not own them.

See ADR 0006 for transition and restart rationale.

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.
  • net10.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
0.2.0-alpha.7 63 7/20/2026
0.2.0-alpha.6 54 7/20/2026
0.2.0-alpha.5 51 7/18/2026
0.1.0-alpha.1 53 7/15/2026