Soenneker.Asyncs.Initializers
4.0.81
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Asyncs.Initializers --version 4.0.81
NuGet\Install-Package Soenneker.Asyncs.Initializers -Version 4.0.81
<PackageReference Include="Soenneker.Asyncs.Initializers" Version="4.0.81" />
<PackageVersion Include="Soenneker.Asyncs.Initializers" Version="4.0.81" />
<PackageReference Include="Soenneker.Asyncs.Initializers" />
paket add Soenneker.Asyncs.Initializers --version 4.0.81
#r "nuget: Soenneker.Asyncs.Initializers, 4.0.81"
#:package Soenneker.Asyncs.Initializers@4.0.81
#addin nuget:?package=Soenneker.Asyncs.Initializers&version=4.0.81
#tool nuget:?package=Soenneker.Asyncs.Initializers&version=4.0.81
Soenneker.Asyncs.Initializers
A lightweight, async-safe, allocation-free one-time initialization gate. Ensures a given asynchronous initialization routine runs exactly once, even under concurrent callers, with support for cancellation, safe publication, and disposal.
Install
dotnet add package Soenneker.Asyncs.Initializers
Quick start
using Soenneker.Asyncs.Initializers.Abstract;
IAsyncInitializer asyncInitializer = /* resolve from DI */;
await asyncInitializer.Init(default);
Executes the initialization routine if it has not yet run; otherwise returns immediately. Concurrent callers will await the same initialization.
What you get
IAsyncInitializer— A lightweight, async-safe, allocation-free one-time initialization gate. Ensures a given asynchronous initialization routine runs exactly once, even under concurrent callers, with support for cancellation, safe publication, and disposal.IAsyncInitializer<T>— Initializes a value asynchronously and exposes it after initialization completes.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
IAsyncInitializer.Init(cancellationToken) |
Executes the initialization routine if it has not yet run; otherwise returns immediately. Concurrent callers will await the same initialization. | A task that completes when the init operation is complete. |
IAsyncInitializer.InitSync(cancellationToken) |
Synchronously initializes the instance. | Returns no value; the requested change is complete when the method returns. |
IAsyncInitializer.IsInitialized |
Gets whether initialization has completed successfully. | Gets whether initialization has completed successfully. |
IAsyncInitializer<T>.Init(value, cancellationToken) |
Executes the initialization routine if it has not yet run; otherwise returns immediately. Concurrent callers will await the same initialization. | A task that completes when the init operation is complete. |
IAsyncInitializer<T>.InitSync(value, cancellationToken) |
Synchronously initializes the instance. | Returns no value; the requested change is complete when the method returns. |
IAsyncInitializer<T>.IsInitialized |
Gets whether initialization has completed successfully. | Gets whether initialization has completed successfully. |
Practical notes
- Cancellation stops pending work; it does not undo work that has already completed.
- Dispose instances you own when their scope ends so held resources can be released.
| 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
- Soenneker.Asyncs.Locks (>= 4.0.68)
- Soenneker.Atomics.ValueBools (>= 4.0.35)
- Soenneker.Extensions.ValueTask (>= 4.0.118)
NuGet packages (30)
Showing the top 5 NuGet packages that depend on Soenneker.Asyncs.Initializers:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.TomSelect
A Blazor interop library for the select user control library, Tom Select |
|
|
Soenneker.TestHosts.Unit
A lightweight host for dependency-driven unit tests. |
|
|
Soenneker.Blazor.FilePond
A Blazor interop library for the file upload library FilePond |
|
|
Soenneker.Blazor.Clarity
A small Blazor interop library that sets up Microsoft Clarity |
|
|
Soenneker.Blazor.Masonry
A lightweight, responsive Blazor component for Masonry (the cascading grid layout library) — perfect for image grids, cards, and dynamic content. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.153 | 6,085 | 12/2/2026 |
| 11.0.152 | 578 | 12/2/2026 |
| 11.0.151 | 9,151 | 12/2/2026 |
| 11.0.150 | 2,710 | 12/2/2026 |
| 11.0.149 | 453 | 12/2/2026 |
| 11.0.148 | 7,328 | 12/1/2026 |
| 11.0.147 | 3,945 | 12/1/2026 |
| 11.0.146 | 3,871 | 11/30/2026 |
| 11.0.145 | 13,213 | 11/29/2026 |
| 11.0.144 | 22,493 | 11/19/2026 |
| 11.0.143 | 602 | 11/18/2026 |
| 11.0.142 | 8,988 | 11/18/2026 |
| 11.0.140 | 36,482 | 11/11/2026 |
| 11.0.139 | 776 | 11/11/2026 |
| 11.0.138 | 2,772 | 11/11/2026 |
| 11.0.137 | 4,465 | 11/10/2026 |
| 11.0.136 | 104 | 11/10/2026 |
| 11.0.135 | 42,930 | 11/2/2026 |
| 11.0.134 | 28,039 | 10/26/2026 |
| 4.0.81 | 223 | 8/29/2026 |
Improve README usability and API guidance