Class RealtimeArchiveWriter
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
InternalTotalProcessedExchanges
protected long InternalTotalProcessedExchanges
Field Value
Properties
TotalProcessedExchanges
Gets the total number of exchanges that have been processed.
public long TotalProcessedExchanges { get; }
Property Value
Methods
ClearErrors()
public abstract void ClearErrors()
ConnectionUpdateRequired(Connection)
Check whether calling Update(ConnectionInfo, CancellationToken) is necessary
protected abstract bool ConnectionUpdateRequired(Connection connection)
Parameters
connectionConnection
Returns
CreateRequestBodyStream(int)
Creates a request body stream for the specified exchange ID.
public abstract Stream CreateRequestBodyStream(int exchangeId)
Parameters
exchangeIdintThe 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
exchangeIdintThe 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
Returns
CreateWebSocketResponseContent(int, int)
Creates the content for the WebSocket response.
public abstract Stream CreateWebSocketResponseContent(int exchangeId, int messageId)
Parameters
Returns
- Stream
A Stream containing the response content.
Dispose()
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
ExchangeUpdateRequired(Exchange)
Check whether calling Update(ExchangeInfo, CancellationToken) is necessary
protected abstract bool ExchangeUpdateRequired(Exchange exchange)
Parameters
exchangeExchange
Returns
GetDumpfilePath(int)
Gets the dump file path for the specified connection ID.
public virtual string GetDumpfilePath(int connectionId)
Parameters
connectionIdintThe 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
connectionInfoDownstreamErrorInfoThe information about the connection.
cancellationTokenCancellationTokenA 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
maxExchangeCountint?The maximum number of exchanges allowed. Pass null for unlimited exchanges.
onMaxExchangeCountReachedActionThe 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
connectionInfoConnectionInfoThe new connection information to be updated.
cancellationTokenCancellationTokenThe cancellation token to cancel the update operation.
Update(Connection, CancellationToken)
Updates the specified connection.
public virtual void Update(Connection connection, CancellationToken cancellationToken)
Parameters
connectionConnectionThe connection to be updated.
cancellationTokenCancellationTokenThe 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
exchangeExchangeThe exchange to update.
updateTypeArchiveUpdateTypeThe type of update to perform.
cancellationTokenCancellationTokenThe 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
errorInfoDownstreamErrorInfoThe new downstream error information to update.
cancellationTokenCancellationTokenA token to cancel the update operation.
Update(ExchangeInfo, CancellationToken)
Updates the exchange information.
public abstract bool Update(ExchangeInfo exchangeInfo, CancellationToken cancellationToken)
Parameters
exchangeInfoExchangeInfoThe exchange information to update.
cancellationTokenCancellationTokenThe 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
tagsIEnumerable<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
ErrorUpdated
Represents an event that is raised when the error is updated downstream.
public event EventHandler<DownstreamErrorEventArgs>? ErrorUpdated
Event Type
ExchangeUpdated
Represents an event that is raised when an exchange is updated.
public event EventHandler<ExchangeUpdateEventArgs>? ExchangeUpdated
Event Type
Remarks
This event provides a notification whenever an exchange is updated.