Soenneker.Asyncs.Initializers 4.0.81

Prefix Reserved
There is a newer version of this package available.
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
                    
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="Soenneker.Asyncs.Initializers" Version="4.0.81" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Asyncs.Initializers" Version="4.0.81" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Asyncs.Initializers" />
                    
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 Soenneker.Asyncs.Initializers --version 4.0.81
                    
#r "nuget: Soenneker.Asyncs.Initializers, 4.0.81"
                    
#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 Soenneker.Asyncs.Initializers@4.0.81
                    
#: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=Soenneker.Asyncs.Initializers&version=4.0.81
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Asyncs.Initializers&version=4.0.81
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 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 (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
Loading failed

Improve README usability and API guidance