void safeProcessUpdate(ObservationListener listener, Date date, double value) { try { listener.onUpdate(date, value); } catch (Exception e) { LogC.err(symbol.name + " failed processing observation " + ymdHuman(date) + ": " + value, e); } }
public void add(ObservationListener listener) { listeners.Add(listener); if (lastDate != null) { safeProcessUpdate(listener, lastDate, lastValue); } }
public void subscribe(Symbol symbol, ObservationListener listener) { observationListeners.get(symbol).add(listener); }