Pocok.Readiness
0.2.0-alpha.7
Prefix Reserved
dotnet add package Pocok.Readiness --version 0.2.0-alpha.7
NuGet\Install-Package Pocok.Readiness -Version 0.2.0-alpha.7
<PackageReference Include="Pocok.Readiness" Version="0.2.0-alpha.7" />
<PackageVersion Include="Pocok.Readiness" Version="0.2.0-alpha.7" />
<PackageReference Include="Pocok.Readiness" />
paket add Pocok.Readiness --version 0.2.0-alpha.7
#r "nuget: Pocok.Readiness, 0.2.0-alpha.7"
#:package Pocok.Readiness@0.2.0-alpha.7
#addin nuget:?package=Pocok.Readiness&version=0.2.0-alpha.7&prerelease
#tool nuget:?package=Pocok.Readiness&version=0.2.0-alpha.7&prerelease
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. BeginStartupis valid fromStoppedorFailedand 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
MarkReadyreleases all waiters. Continuations are scheduled asynchronously. - Failure faults waiters with
ReadinessFailedExceptionand preserves a caller-safeReadinessFailure. - Startup cancellation cancels current waiters with the supplied cancelled token and remains distinct from failure.
BeginShutdownremoves readiness immediately. Waiters from an interrupted startup receiveReadinessStoppedException; 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 | 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
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 |