PipeWriter.CompleteAsync(Exception) 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.
Marks the current pipe writer instance as being complete, meaning no more data will be written to it.
public virtual System.Threading.Tasks.ValueTask CompleteAsync (Exception exception = default);
public virtual System.Threading.Tasks.ValueTask CompleteAsync (Exception? exception = default);
abstract member CompleteAsync : Exception -> System.Threading.Tasks.ValueTask
override this.CompleteAsync : Exception -> System.Threading.Tasks.ValueTask
Public Overridable Function CompleteAsync (Optional exception As Exception = Nothing) As ValueTask
Parameters
- exception
- Exception
An optional exception that indicates the failure that caused the pipeline to complete.
Returns
A value task that represents the asynchronous complete operation.
Remarks
This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Complete(Exception).
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應