//
/** unregister : based on past */
for (final Instrument inst : unregisterSet) {
final MarketDo market = marketMap.get(inst);
market.runSafe(safeUnregister, regTaker);
}
/** update : based on merge of next and past */
for (final Instrument inst : updateSet) {
final MarketDo market = marketMap.get(inst);
market.runSafe(safeUpdate, regTaker);
}
/** past = next */
regTaker.bind();
/** register : based on next */
for (final Instrument inst : registerSet) {
if (!isValid(inst)) {
continue;
}
if (!isRegistered(inst)) {
register(inst);
}
final MarketDo market = marketMap.get(inst);
market.runSafe(safeRegister, regTaker);
}
/** remove / notify */
for (final Instrument inst : changeNotifySet) {
final MarketDo market = marketMap.get(inst);
if (!market.hasRegTakers()) {
unregister(inst);
}
notifyRegListeners(market);