TeamsStreamingWriter.FinalizeResponseAsync 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.
Sends the final streaming activity and marks the stream complete.
public System.Threading.Tasks.Task FinalizeResponseAsync(Microsoft.Teams.Apps.MessageActivityInput? final = default, System.Threading.CancellationToken cancellationToken = default);
member this.FinalizeResponseAsync : Microsoft.Teams.Apps.MessageActivityInput * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function FinalizeResponseAsync (Optional final As MessageActivityInput = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- final
- MessageActivityInput
The final message activity. If null, a plain MessageActivity is built
from the accumulated streamed text. If non-null, the caller-supplied activity is used as-is;
when its Text is null, the accumulated text is filled in
(pass "" explicitly to send an attachment-only reply).
- cancellationToken
- CancellationToken
Cancellation token.
Returns
Exceptions
Thrown if the final activity has neither text nor attachments.
Remarks
Finalizing is idempotent until the next append or informative update reopens the stream. If streaming exceeded the two-minute limit, the final content updates the original streamed message in place instead of sending a new streamed chunk.