/// <summary> /// Start polling the configuration source with the specified scheduler. /// </summary> /// <param name="source">PolledConfigurationSource to poll</param> /// <param name="scheduler"> /// AbstractPollingScheduler whose <see cref="AbstractPollingScheduler.SchedulePollingAction"/> will be used to determine the polling schedule /// </param> public void StartPolling(IPolledConfigurationSource source, AbstractPollingScheduler scheduler) { lock (m_ObjectLock) { m_Scheduler = scheduler; m_Source = source; Init(source, scheduler); scheduler.StartPolling(source, this); } }
/// <summary> /// Initialize the configuration. This method is called in <see cref="DynamicConfiguration"/> and <see cref="StartPolling"/> /// before the initial polling. The default implementation does nothing. /// </summary> /// <param name="source"></param> /// <param name="scheduler"></param> protected virtual void Init(IPolledConfigurationSource source, AbstractPollingScheduler scheduler) { }
/// <summary> /// Create an instance and start polling the configuration source. /// </summary> /// <param name="source">PolledConfigurationSource to poll</param> /// <param name="scheduler"> /// AbstractPollingScheduler whose <see cref="AbstractPollingScheduler.SchedulePollingAction"/> will be used to determine the polling schedule /// </param> public DynamicConfiguration(IPolledConfigurationSource source, AbstractPollingScheduler scheduler) : this() { StartPolling(source, scheduler); }