Share via


IStreamingResponse.EndStreamAsync(CancellationToken) Method

Definition

Ends the stream by sending the final message to the client.

public System.Threading.Tasks.Task EndStreamAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member EndStreamAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function EndStreamAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

cancellationToken
CancellationToken

Returns

A Task representing the async operation

Exceptions

InvalidOperationException

Throws if the stream has already ended.

Throws if the stream has already ended.

Remarks

Since the messages are sent on an interval, this call will block until all have been sent before sending the final Message.

Applies to