Sisk

Class

HttpRequestEventSource

Namespace
Sisk.Core.Http.Streams
Assembly
Sisk.Core.dll

An HttpRequestEventSource instance opens a persistent connection to the request, which sends events in text/event-stream format.

C#
public sealed class HttpRequestEventSource : IDisposable

Inheritance #

object ← HttpRequestEventSource

Implements #

IDisposable

Inherited Members #

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties #

NameDescription
HttpRequestGets the HttpRequest object which created this Event Source instance.
IdentifierGets an unique identifier label to this EventStream connection, useful for finding this connection’s reference later.
IsActiveGets an boolean indicating if this connection is open and this instance can send messages.
PingPolicyGets the HttpStreamPingPolicy for this HTTP event source connection.
SentContentLengthGets an integer indicating the total bytes sent by this instance to the client.

Methods #

NameDescription
AppendHeader(string, string)Sends an header to the streaming context.
Cancel()Cancels the sending queue from sending pending messages and clears the queue.
Close()Closes the event listener and it’s connection.
CloseAsync()Asynchronously closes the event listener and its connection.
Dispose()Releases the used resources of this class instance.
KeepAlive()Keeps the event source alive indefinitely.
Send(string?, string)Sends an event to the client over the HTTP connection.
SendAsync(string?, string)Asynchronously sends an event to the client over the HTTP connection.
WaitForFail(TimeSpan)Waits for the event source to fail or reach the specified idle tolerance.
WaitForFailAsync(TimeSpan)Asynchronously waits for the event source to fail or reach the specified idle tolerance.
WaitForFailAsync(CancellationToken)Asynchronously waits for the event source to fail or be canceled.
WithPing(Action<HttpStreamPingPolicy>)Configures the ping policy for this instance of HTTP Event Source.

Type to search the documentation and the API reference.