ChannelWriter<T>.WaitToWriteAsync(CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.