Skip to main content

diff_and_emit_statuses

Function diff_and_emit_statuses 

Source
pub fn diff_and_emit_statuses(
    new_statuses: &AHashMap<InstrumentId, MarketStatusAction>,
    cached_statuses: &mut AHashMap<InstrumentId, MarketStatusAction>,
    subscriptions: Option<&AHashSet<InstrumentId>>,
    sender: &UnboundedSender<DataEvent>,
    ts_event: UnixNanos,
    ts_init: UnixNanos,
)
Expand description

Compares new status snapshot against cached state, emitting [InstrumentStatus] events for changes and removals.

The cache is always updated to reflect the full API state. Emissions are gated by subscriptions: only instruments present in the subscription set produce events. Pass None to emit for all changes unconditionally.

Symbols present in the cache but absent from the new snapshot are treated as removed and emit NotAvailableForTrading (if subscribed).