Пример #1
0
    public void Dispose()
    {
      subscribeToBackContractCandles(false);
      subscribeToFrontContractCandles(false);
      subscribeToSpreadContractCandles(false);
      subscribeToFrontContractPrice(false);
      subscribeToSpreadContractPrice(false);
      subscribeToSyncPoint(false);

      m_bbgLive_candles_BackContract = null;
      m_bbgLive_candles_FrontContract = null;
      m_bbgLive_candles_spread = null;
      m_syncPoint = null;

      if (m_dayBeginMonitor != null)
      {
        m_dayBeginMonitor.Dispose();
        m_dayBeginMonitor = null;
      }

      foreach (var monitor in m_monitors)
        monitor.Value.Dispose();

      m_monitors.Clear();
    }
Пример #2
0
    public void PublishUpdatesInSyncWith(INewLineEventImplementor syncPoint_)
    {
      if (Status() != RollStatus.Finished)
      {
        Logger.Error(
          "Day is being asked to keep in sync with something else, but is live itself.  This should not happen",
          typeof(Day));
        throw new Exception("Cannot keep day in sync with something else as it's live itself");
      }

      subscribeToSyncPoint(false);
      m_syncPoint = syncPoint_;
      subscribeToSyncPoint();

      syncPoint_.PublishNow();
    }