コード例 #1
0
 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;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 private void InitHeartBeatTimer()
 {
     DateTime start = DateTime.Now.AddSeconds(1);
     TimeSpan interval = TimeSpan.FromMilliseconds(ConfigurationManager.HeartBeatInterval);
     heartBeatRuntime = AsyncTaskExecuter.ExecuteIntervalTask(start, interval, SendHeartBeat, ReceivedHeartBeatResponse);
 }
コード例 #4
0
 public void startUpdateDaemon()
 { 
     DateTime StartTime = DateTime.Now.AddSeconds(15);
     TimeSpan Interval = TimeSpan.FromSeconds(ConfigurationManager.UpdateCheckInterval);
     CheckUpdateRuntime = AsyncTaskExecuter.ExecuteIntervalTask(StartTime, Interval, getRemoteVersion, getVersionCallback);
 }