Class AsyncLazy<T>
Provides support for asynchronous lazy initialization. This type is fully threadsafe.
Inherited Members
Namespace:FubarDev.WebDavServer
Assembly:FubarDev.WebDavServer.dll
Syntax
public sealed class AsyncLazy<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of object that is being asynchronously initialized. |
Constructors
| Improve this Doc View SourceAsyncLazy(Func<Task<T>>)
Initializes a new instance of the AsyncLazy<T> class.
Declaration
public AsyncLazy([NotNull] Func<Task<T>> factory)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<T>> | factory | The asynchronous delegate that is invoked to produce the value when it is needed. May not be |
Properties
| Improve this Doc View SourceTask
Gets the resulting task.
Declaration
[NotNull]
public Task<T> Task { get; }
Property Value
| Type | Description |
|---|---|
| Task<T> |
Remarks
Starts the asynchronous factory method, if it has not already started.