示例#1
0
        // The reason we need to check CheckTimerFreeze on both the SafeTimer and this GrainTimer
        // is that SafeTimer may tick OK (no starvation by .NET thread pool), but then scheduler.QueueWorkItem
        // may not execute and starve this GrainTimer callback.
        public bool CheckTimerFreeze(DateTime lastCheckTime)
        {
            if (TimerAlreadyStopped)
            {
                return(true);
            }
            // check underlying SafeTimer (checking that .NET thread pool does not starve this timer)
            if (!timer.CheckTimerFreeze(lastCheckTime, () => Name))
            {
                return(false);
            }
            // if SafeTimer failed the check, no need to check GrainTimer too, since it will fail as well.

            // check myself (checking that scheduler.QueueWorkItem does not starve this timer)
            return(SafeTimerBase.CheckTimerDelay(previousTickTime, totalNumTicks,
                                                 dueTime, timerFrequency, logger, GetFullName, ErrorCode.Timer_TimerInsideGrainIsNotTicking, true));
        }
示例#2
0
 public bool CheckTimerDelay()
 {
     return(SafeTimerBase.CheckTimerDelay(previousTickTime, totalNumTicks,
                                          dueTime, timerFrequency, logger, GetFullName, ErrorCode.Timer_TimerInsideGrainIsNotTicking, false));
 }
示例#3
0
 public AsyncTaskSafeTimer(Func<object, Task> asynTaskCallback, object state, TimeSpan dueTime, TimeSpan period)
 {
     safeTimerBase = new SafeTimerBase(asynTaskCallback, state, dueTime, period);
 }
示例#4
0
 public SafeTimer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
 {
     callbackFunc = callback;
     safeTimerBase = new SafeTimerBase(callbackFunc, state, dueTime, period);
 }
示例#5
0
 public AsyncTaskSafeTimer(Func<object, Task> asynTaskCallback, object state)
 {
     safeTimerBase = new SafeTimerBase(asynTaskCallback, state);
 }
示例#6
0
 public AsyncTaskSafeTimer(ILogger logger, Func <object, Task> asynTaskCallback, object state, TimeSpan dueTime, TimeSpan period)
 {
     safeTimerBase = new SafeTimerBase(logger, asynTaskCallback, state, dueTime, period);
 }
示例#7
0
 public SafeTimer(TimerCallback callback, object state)
 {
     callbackFunc = callback;
     safeTimerBase = new SafeTimerBase(callbackFunc, state);
 }
示例#8
0
 public AsyncTaskSafeTimer(ILogger logger, Func <object, Task> asynTaskCallback, object state)
 {
     safeTimerBase = new SafeTimerBase(logger, asynTaskCallback, state);
 }
示例#9
0
 public AsyncTaskSafeTimer(Func <object, Task> asynTaskCallback, object state)
 {
     safeTimerBase = new SafeTimerBase(asynTaskCallback, state);
 }
示例#10
0
 public SafeTimer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
 {
     callbackFunc  = callback;
     safeTimerBase = new SafeTimerBase(callbackFunc, state, dueTime, period);
 }
示例#11
0
 public SafeTimer(TimerCallback callback, object state)
 {
     callbackFunc  = callback;
     safeTimerBase = new SafeTimerBase(callbackFunc, state);
 }
示例#12
0
 public SafeTimer(ILogger logger, TimerCallback callback, object state)
 {
     callbackFunc  = callback;
     safeTimerBase = new SafeTimerBase(logger, callbackFunc, state);
 }