public static IntervalTaskRuntime ExecuteIntervalTask(DateTime startTime, TimeSpan interval, Func<string> task, Action<string> callback) { IntervalTaskRuntime runtime = new IntervalTaskRuntime(); runtime.Task = task; runtime.Callback = callback; runtime.Invoke(startTime,interval); return runtime; }
public static IntervalTaskRuntime ExecuteIntervalTask(DateTime startTime, TimeSpan interval, Func <string> task, Action <string> callback) { IntervalTaskRuntime runtime = new IntervalTaskRuntime(); runtime.Task = task; runtime.Callback = callback; runtime.Invoke(startTime, interval); return(runtime); }
private void InitHeartBeatTimer() { DateTime start = DateTime.Now.AddSeconds(1); TimeSpan interval = TimeSpan.FromMilliseconds(ConfigurationManager.HeartBeatInterval); heartBeatRuntime = AsyncTaskExecuter.ExecuteIntervalTask(start, interval, SendHeartBeat, ReceivedHeartBeatResponse); }
public void startUpdateDaemon() { DateTime StartTime = DateTime.Now.AddSeconds(15); TimeSpan Interval = TimeSpan.FromSeconds(ConfigurationManager.UpdateCheckInterval); CheckUpdateRuntime = AsyncTaskExecuter.ExecuteIntervalTask(StartTime, Interval, getRemoteVersion, getVersionCallback); }