ILookupTrackingManagerState
State storage for LookupTrackingMessageAdapter. Stores active lookup requests, queued lookups and timeout tracking.
Properties
public DateTime PreviousTime { get; set; }
value = iLookupTrackingManagerState.PreviousTime
iLookupTrackingManagerState.PreviousTime = value
Previous time for diff calculation.
Methods
public void AddLookup(long transactionId, ISubscriptionMessage subscription, TimeSpan timeout)
iLookupTrackingManagerState.AddLookup(transactionId, subscription, timeout)
Add a tracked lookup with timeout.
- transactionId
- Transaction ID.
- subscription
- Subscription message (cloned).
- timeout
- Timeout duration.
public void IncreaseTimeOut(long[] subscriptionIds)
iLookupTrackingManagerState.IncreaseTimeOut(subscriptionIds)
Increase timeout for subscriptions that received data.
- subscriptionIds
- Subscription IDs that received data.
public IEnumerable<ValueTuple<ISubscriptionMessage, Message>> ProcessTimeouts(TimeSpan diff, long[] ignoreIds)
result = iLookupTrackingManagerState.ProcessTimeouts(diff, ignoreIds)
Process time elapsed and return timed-out lookups. Removes timed-out entries from tracking.
- diff
- Time elapsed since last check.
- ignoreIds
- Subscription IDs to skip (they just received data).
Returns: Timed-out lookups.
public void RemoveLookup(long transactionId)
iLookupTrackingManagerState.RemoveLookup(transactionId)
Remove a tracked lookup.
- transactionId
- Transaction ID.
public Message TryDequeueFromAnyType(long removingId)
result = iLookupTrackingManagerState.TryDequeueFromAnyType(removingId)
Try to dequeue from any type queue after removing the specified ID.
- removingId
- Transaction ID to remove.
Returns: Next queued message, or null.
public Message TryDequeueNext(MessageTypes type, long removingId)
result = iLookupTrackingManagerState.TryDequeueNext(type, removingId)
Try to dequeue the next subscription of the given type after removing the specified ID.
- type
- Message type.
- removingId
- Transaction ID to remove from queue.
Returns: Next queued message, or null.
public bool TryEnqueue(MessageTypes type, long transactionId, ISubscriptionMessage message)
result = iLookupTrackingManagerState.TryEnqueue(type, transactionId, message)
Try to enqueue a subscription into the per-type queue.
- type
- Message type.
- transactionId
- Transaction ID.
- message
- Subscription message (cloned).
Returns: True if the subscription was queued (not the first in queue), false if it should proceed immediately.
public bool TryGetAndRemoveLookup(long transactionId, ISubscriptionMessage subscription)
result = iLookupTrackingManagerState.TryGetAndRemoveLookup(transactionId, subscription)
Try get and remove a tracked lookup.
- transactionId
- Transaction ID.
- subscription
- Found subscription, or null.
Returns: True if found and removed.