Interface IStreamingResponse
public interface IStreamingResponse
Properties
EndStreamTimeout
The time in milliseconds that EndStream or Reset wait. After this period expires, the final message will be sent.
int EndStreamTimeout { get; set; }
Property Value
FinalMessage
Set IActivity that will be (optionally) used for the final streaming message.
IActivity FinalMessage { get; set; }
Property Value
- IActivity
Interval
The interval in milliseconds at which intermediate messages are sent.
int Interval { get; set; }
Property Value
Remarks
Teams default: 1000 WebChat default: 500
IsStreamingChannel
Indicate if the current channel supports intermediate messages.
bool IsStreamingChannel { get; }
Property Value
Remarks
Channels that don't support intermediate messages will buffer text, and send a normal final message when EndStreamAsync is called.
Message
The buffered message.
string Message { get; }
Property Value
Methods
EndStreamAsync(CancellationToken)
Ends the stream by sending the final message to the client.
Task EndStreamAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken
Returns
- Task
A Task representing the async operation
Remarks
Since the messages are sent on an interval, this call will block until all have been sent before sending the final Message.
IsStreamStarted()
bool IsStreamStarted()
Returns
QueueInformativeUpdateAsync(string, CancellationToken)
Queues an informative update to be sent to the client.
Task QueueInformativeUpdateAsync(string text, CancellationToken cancellationToken = default)
Parameters
text
stringText of the update to send.
cancellationToken
CancellationToken
Returns
QueueTextChunk(string)
Queues a chunk of partial message text to be sent to the client.
void QueueTextChunk(string text)
Parameters
text
stringPartial text of the message to send.
ResetAsync(CancellationToken)
Reset an already used stream. If the stream is still running, this will wait for completion.
Task ResetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken
Returns
UpdatesSent()
Gets the number of updates sent for the stream.
int UpdatesSent()
Returns
- int
Number of updates sent so far.