SseResultExtensions.ToSseResult<T> 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.
Converts an async enumerable source to an SSE result with frame transformation.
public static Azure.AI.AgentServer.Core.Common.Http.ServerSentEvent.SseResult ToSseResult<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, Func<T,Azure.AI.AgentServer.Core.Common.Http.ServerSentEvent.SseFrame> frameTransformer, Microsoft.Extensions.Logging.ILogger logger, System.Threading.CancellationToken ct = default, TimeSpan? keepAliveInterval = default);
static member ToSseResult : System.Collections.Generic.IAsyncEnumerable<'T> * Func<'T, Azure.AI.AgentServer.Core.Common.Http.ServerSentEvent.SseFrame> * Microsoft.Extensions.Logging.ILogger * System.Threading.CancellationToken * Nullable<TimeSpan> -> Azure.AI.AgentServer.Core.Common.Http.ServerSentEvent.SseResult
<Extension()>
Public Function ToSseResult(Of T) (source As IAsyncEnumerable(Of T), frameTransformer As Func(Of T, SseFrame), logger As ILogger, Optional ct As CancellationToken = Nothing, Optional keepAliveInterval As Nullable(Of TimeSpan) = Nothing) As SseResult
Type Parameters
- T
The type of items in the source sequence.
Parameters
- source
- IAsyncEnumerable<T>
The source async enumerable.
- logger
- ILogger
Logger for diagnostic information.
Cancellation token.
Returns
An SSE result that can be returned from an endpoint.