Class SimpleMessageQueue<TMessage>
- Namespace
- ATAS.DataFeedsCore
- Assembly
- ATAS.DataFeedsCore.dll
The queue of a single connector with its own process thread; the default queue of BaseConnector<TMessage, TPortfolioKey, TSecurityKey, TSecurityPositionManager>.
public sealed class SimpleMessageQueue<TMessage> : BaseMessageQueue<TMessage, (TMessage? Message, Action? Action)>, ILoggerSource
Type Parameters
TMessageThe type of the connector's messages.
- Inheritance
-
objectBaseLoggerSourceSimpleMessageQueue<TMessage>
- Implements
- Extension Methods
Constructors
SimpleMessageQueue()
public SimpleMessageQueue()
Methods
CreateItem(IDataFeedConnector, TMessage?, Action?)
Packs a message or an action of a connector into a queue item; exactly one of message and
action is set.
Added in ATAS 8.0.15.
protected override (TMessage? Message, Action? Action) CreateItem(IDataFeedConnector connector, TMessage? message, Action? action)
Parameters
connectorIDataFeedConnectorThe connector the item belongs to.
messageTMessageThe message, or null for an action.
actionActionThe action, or null for a message.
Returns
- (TMessage Message, Action Action)
The queue item.
DescribeItem((TMessage? Message, Action? Action))
Short representation of a queued item for debug logging. Full message dumps are logged by connectors on receive; dumping them again here would double the cost.
Added in ATAS 8.0.15.
protected override object? DescribeItem((TMessage? Message, Action? Action) item)
Parameters
item(TMessage Message, Action Action)
Returns
- object
OnProcess((TMessage? Message, Action? Action))
Passes the message to the handler and runs the action; with no handler registered the item is dropped with a warning.
protected override void OnProcess((TMessage? Message, Action? Action) item)
Parameters
item(TMessage Message, Action Action)The item.
OnStart(IDataFeedConnector, Action<TMessage>)
Takes the handler; the queue serves one connector, a later start replaces it.
protected override void OnStart(IDataFeedConnector connector, Action<TMessage> handler)
Parameters
connectorIDataFeedConnectorThe connector.
handlerAction<TMessage>The connector's message handler.
OnStop(IDataFeedConnector)
Drops the handler; the session always ends.
protected override bool OnStop(IDataFeedConnector connector)
Parameters
connectorIDataFeedConnectorThe connector.
Returns
- bool
Always true.