Table of Contents

Class RealtimeArchiveWriter

Namespace
Fluxzy.Writers
Assembly
Fluxzy.Core.dll

Represents a base class for writing real-time archive data.

public abstract class RealtimeArchiveWriter
Inheritance
RealtimeArchiveWriter
Derived
Inherited Members

Fields

ErrorCount

protected int ErrorCount

Field Value

int

InternalTotalProcessedExchanges

protected long InternalTotalProcessedExchanges

Field Value

long

Properties

TotalProcessedExchanges

Gets the total number of exchanges that have been processed.

public long TotalProcessedExchanges { get; }

Property Value

long

Methods

ClearErrors()

public abstract void ClearErrors()

ConnectionUpdateRequired(Connection)

Check whether calling Update(ConnectionInfo, CancellationToken) is necessary

protected abstract bool ConnectionUpdateRequired(Connection connection)

Parameters

connection Connection

Returns

bool

CreateRequestBodyStream(int)

Creates a request body stream for the specified exchange ID.

public abstract Stream CreateRequestBodyStream(int exchangeId)

Parameters

exchangeId int

The ID of the exchange.

Returns

Stream

A stream representing the request body.

CreateResponseBodyStream(int)

Creates the response body stream for the given exchange ID.

public abstract Stream CreateResponseBodyStream(int exchangeId)

Parameters

exchangeId int

The identifier of the exchange.

Returns

Stream

The response body stream.

CreateWebSocketRequestContent(int, int)

Creates the content of a WebSocket request.

public abstract Stream CreateWebSocketRequestContent(int exchangeId, int messageId)

Parameters

exchangeId int

The ID of the exchange.

messageId int

The ID of the message.

Returns

Stream

A Stream representing the content of the WebSocket request.

CreateWebSocketResponseContent(int, int)

Creates the content for the WebSocket response.

public abstract Stream CreateWebSocketResponseContent(int exchangeId, int messageId)

Parameters

exchangeId int

The ID of the exchange.

messageId int

The ID of the message.

Returns

Stream

A Stream containing the response content.

Dispose()

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

ExchangeUpdateRequired(Exchange)

Check whether calling Update(ExchangeInfo, CancellationToken) is necessary

protected abstract bool ExchangeUpdateRequired(Exchange exchange)

Parameters

exchange Exchange

Returns

bool

GetDumpfilePath(int)

Gets the dump file path for the specified connection ID.

public virtual string GetDumpfilePath(int connectionId)

Parameters

connectionId int

The ID of the connection.

Returns

string

The dump file path as a string.

Init()

public virtual void Init()

InternalUpdate(DownstreamErrorInfo, CancellationToken)

Performs the internal update logic for the specified connection.

protected abstract void InternalUpdate(DownstreamErrorInfo connectionInfo, CancellationToken cancellationToken)

Parameters

connectionInfo DownstreamErrorInfo

The information about the connection.

cancellationToken CancellationToken

A cancellation token to cancel the operation.

RegisterExchangeLimit(int?, Action)

Registers the exchange limit for the system.

public virtual void RegisterExchangeLimit(int? maxExchangeCount, Action onMaxExchangeCountReached)

Parameters

maxExchangeCount int?

The maximum number of exchanges allowed. Pass null for unlimited exchanges.

onMaxExchangeCountReached Action

The action to be invoked when the maximum exchange count is reached.

Update(ConnectionInfo, CancellationToken)

Updates the connection information for the given connection.

public abstract void Update(ConnectionInfo connectionInfo, CancellationToken cancellationToken)

Parameters

connectionInfo ConnectionInfo

The new connection information to be updated.

cancellationToken CancellationToken

The cancellation token to cancel the update operation.

Update(Connection, CancellationToken)

Updates the specified connection.

public virtual void Update(Connection connection, CancellationToken cancellationToken)

Parameters

connection Connection

The connection to be updated.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Update(Exchange, ArchiveUpdateType, CancellationToken)

Updates an exchange with the specified update type.

public virtual void Update(Exchange exchange, ArchiveUpdateType updateType, CancellationToken cancellationToken)

Parameters

exchange Exchange

The exchange to update.

updateType ArchiveUpdateType

The type of update to perform.

cancellationToken CancellationToken

The cancellation token to cancel the update operation.

Update(DownstreamErrorInfo, CancellationToken)

Updates the downstream error information and triggers an event when the error count is increased.

public virtual void Update(DownstreamErrorInfo errorInfo, CancellationToken cancellationToken)

Parameters

errorInfo DownstreamErrorInfo

The new downstream error information to update.

cancellationToken CancellationToken

A token to cancel the update operation.

Update(ExchangeInfo, CancellationToken)

Updates the exchange information.

public abstract bool Update(ExchangeInfo exchangeInfo, CancellationToken cancellationToken)

Parameters

exchangeInfo ExchangeInfo

The exchange information to update.

cancellationToken CancellationToken

The cancellation token.

Returns

bool

Returns a value indicating whether the update was successful.

UpdateTags(IEnumerable<Tag>)

Updates the tags associated with the item.

public abstract void UpdateTags(IEnumerable<Tag> tags)

Parameters

tags IEnumerable<Tag>

The tags to be updated.

Events

ConnectionUpdated

Represents an event that is raised when a connection is created or updated.

public event EventHandler<ConnectionUpdateEventArgs>? ConnectionUpdated

Event Type

EventHandler<ConnectionUpdateEventArgs>

ErrorUpdated

Represents an event that is raised when the error is updated downstream.

public event EventHandler<DownstreamErrorEventArgs>? ErrorUpdated

Event Type

EventHandler<DownstreamErrorEventArgs>

ExchangeUpdated

Represents an event that is raised when an exchange is updated.

public event EventHandler<ExchangeUpdateEventArgs>? ExchangeUpdated

Event Type

EventHandler<ExchangeUpdateEventArgs>

Remarks

This event provides a notification whenever an exchange is updated.