TaskAsyncEnumerableExtensions.ConfigureAwait 方法

定义

重载

ConfigureAwait(IAsyncDisposable, Boolean)

配置如何执行从异步可处置项返回的任务的等待。Configures how awaits on the tasks returned from an async disposable are performed.

ConfigureAwait<T>(IAsyncEnumerable<T>, Boolean)

配置如何执行从异步迭代返回的任务的等待。Configures how awaits on the tasks returned from an async iteration are performed.

ConfigureAwait(IAsyncDisposable, Boolean)

配置如何执行从异步可处置项返回的任务的等待。Configures how awaits on the tasks returned from an async disposable are performed.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::ConfiguredAsyncDisposable ConfigureAwait(IAsyncDisposable ^ source, bool continueOnCapturedContext);
public static System.Runtime.CompilerServices.ConfiguredAsyncDisposable ConfigureAwait (this IAsyncDisposable source, bool continueOnCapturedContext);
static member ConfigureAwait : IAsyncDisposable * bool -> System.Runtime.CompilerServices.ConfiguredAsyncDisposable
<Extension()>
Public Function ConfigureAwait (source As IAsyncDisposable, continueOnCapturedContext As Boolean) As ConfiguredAsyncDisposable

参数

source
IAsyncDisposable

源异步可处置项。The source async disposable.

continueOnCapturedContext
Boolean

若要捕获并封装回当前上下文,则为 true;否则为 falsetrue to capture and marshal back to the current context; otherwise, false.

返回

ConfiguredAsyncDisposable

配置的异步可处置项。The configured async disposable.

适用于

ConfigureAwait<T>(IAsyncEnumerable<T>, Boolean)

配置如何执行从异步迭代返回的任务的等待。Configures how awaits on the tasks returned from an async iteration are performed.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Runtime::CompilerServices::ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait(System::Collections::Generic::IAsyncEnumerable<T> ^ source, bool continueOnCapturedContext);
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T>? ConfigureAwait<T> (this System.Collections.Generic.IAsyncEnumerable<T> source, bool continueOnCapturedContext);
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait<T> (this System.Collections.Generic.IAsyncEnumerable<T> source, bool continueOnCapturedContext);
static member ConfigureAwait : System.Collections.Generic.IAsyncEnumerable<'T> * bool -> System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<'T>
<Extension()>
Public Function ConfigureAwait(Of T) (source As IAsyncEnumerable(Of T), continueOnCapturedContext As Boolean) As ConfiguredCancelableAsyncEnumerable(Of T)

类型参数

T

要循环访问的对象的类型。The type of the objects to iterate.

参数

source
IAsyncEnumerable<T>

要循环访问的源可枚举项。The source enumerable to iterate.

continueOnCapturedContext
Boolean

若要捕获并封装回当前上下文,则为 true;否则为 falsetrue to capture and marshal back to the current context; otherwise, false.

返回

ConfiguredCancelableAsyncEnumerable<T>

配置的可枚举项。The configured enumerable.

适用于