Bewerken

Delen via


ChannelWriter<T>.WaitToWriteAsync(CancellationToken) Method

Definition

Returns a ValueTask<TResult> that will complete when space is available to write an item.

public abstract System.Threading.Tasks.ValueTask<bool> WaitToWriteAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member WaitToWriteAsync : System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
Public MustOverride Function WaitToWriteAsync (Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Boolean)

Parameters

cancellationToken
CancellationToken

A CancellationToken used to cancel the wait operation.

Returns

A ValueTask<TResult> that will complete with a true result when space is available to write an item or with a false result when no further writing will be permitted.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Applies to