AsyncLazy<T> Constructor (Func<Task<T>^>^, JoinableTaskFactory^)

 

Initializes a new instance of AsyncLazy.

Namespace:   Microsoft.VisualStudio.Threading
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.

Return to top
Show: