IStreamingResponse.EndStreamAsync(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.
Ends the stream by sending the final message to the client.
public System.Threading.Tasks.Task<Microsoft.Agents.Builder.StreamingResponseResult> EndStreamAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member EndStreamAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Builder.StreamingResponseResult>
Public Function EndStreamAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of StreamingResponseResult)
Parameters
- cancellationToken
- CancellationToken
Returns
A Task representing the async operation. The result indicates the outcome of ending the stream, such as Success, AlreadyEnded, Timeout, or Error.
Exceptions
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.