From 69f13e43dfdd8069459800ccc3039f45fc884814 Mon Sep 17 00:00:00 2001 From: vnugent Date: Wed, 15 May 2024 22:04:43 -0400 Subject: fix: #3 Defer vault loading until a secret actually needs it --- lib/VNLib.Plugins.Extensions.Loading/src/IAsyncLazy.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/VNLib.Plugins.Extensions.Loading/src/IAsyncLazy.cs') diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/IAsyncLazy.cs b/lib/VNLib.Plugins.Extensions.Loading/src/IAsyncLazy.cs index 482785c..cb907b9 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/IAsyncLazy.cs +++ b/lib/VNLib.Plugins.Extensions.Loading/src/IAsyncLazy.cs @@ -52,6 +52,12 @@ namespace VNLib.Plugins.Extensions.Loading /// If the operation has not completed, throws an exception. /// T Value { get; } + + /// + /// Gets or allocates a task that represents the async result + /// + /// A task that represents the asynchronous lazy result that completes with the resulting value + Task AsTask(); } /// @@ -141,6 +147,9 @@ namespace VNLib.Plugins.Extensions.Loading /// public TaskAwaiter GetAwaiter() => _task.GetAwaiter(); + + /// + public Task AsTask() => _task; } #nullable enable -- cgit