AsyncLazy<T> Constructor (Func<Task<T>^>^, JoinableTaskFactory^)
Visual Studio 2015
Initializes a new instance of AsyncLazy.
Assembly: Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)
public:
AsyncLazy(
Func<Task<T>^>^ valueFactory,
JoinableTaskFactory^ joinableTaskFactory = null
)
Parameters
- valueFactory
-
Type:
System::Func<Task<T>^>^
The asynchronous function that produces the value. the function should be invoked at most once.
- joinableTaskFactory
-
Type:
Microsoft.VisualStudio.Threading::JoinableTaskFactory^
The factory to use when invoking the value factory in GetValueAsync to avoid deadlocks when the main thread is required by the value factory.
Show: