Table of Contents

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.

public sealed class HttpRequestEventSource : IDisposable
Inheritance
HttpRequestEventSource
Implements
Inherited Members

Properties

HttpRequest

Gets the HttpRequest object which created this Event Source instance.

Identifier

Gets an unique identifier label to this EventStream connection, useful for finding this connection's reference later.

IsActive

Gets an boolean indicating if this connection is open and this instance can send messages.

PingPolicy

Gets the HttpStreamPingPolicy for this HTTP event source connection.

SentContentLength

Gets an integer indicating the total bytes sent by this instance to the client.

Methods

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.

Dispose()

Flushes and releases the used resources of this class instance.

KeepAlive()

Asynchronously waits for the connection to close before continuing execution. This method is released when either the client or the server reaches an sending failure.

Send(object?)

Writes a event message with their data to the event listener and returns an boolean indicating if the message was delivered to the client.

Send(string)

Writes a event message with their data to the event listener and returns an boolean indicating if the message was delivered to the client.

WaitForFail(TimeSpan)

Asynchronously waits for the connection to close before continuing execution with an maximum keep alive timeout. This method is released when either the client or the server reaches an sending failure.

WithPing(Action<HttpStreamPingPolicy>)

Configures the ping policy for this instance of HTTP Event Source.