// 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)); }
public bool CheckTimerDelay() { return(SafeTimerBase.CheckTimerDelay(previousTickTime, totalNumTicks, dueTime, timerFrequency, logger, GetFullName, ErrorCode.Timer_TimerInsideGrainIsNotTicking, false)); }
public AsyncTaskSafeTimer(Func<object, Task> asynTaskCallback, object state, TimeSpan dueTime, TimeSpan period) { safeTimerBase = new SafeTimerBase(asynTaskCallback, state, dueTime, period); }
public SafeTimer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period) { callbackFunc = callback; safeTimerBase = new SafeTimerBase(callbackFunc, state, dueTime, period); }
public AsyncTaskSafeTimer(Func<object, Task> asynTaskCallback, object state) { safeTimerBase = new SafeTimerBase(asynTaskCallback, state); }
public AsyncTaskSafeTimer(ILogger logger, Func <object, Task> asynTaskCallback, object state, TimeSpan dueTime, TimeSpan period) { safeTimerBase = new SafeTimerBase(logger, asynTaskCallback, state, dueTime, period); }
public SafeTimer(TimerCallback callback, object state) { callbackFunc = callback; safeTimerBase = new SafeTimerBase(callbackFunc, state); }
public AsyncTaskSafeTimer(ILogger logger, Func <object, Task> asynTaskCallback, object state) { safeTimerBase = new SafeTimerBase(logger, asynTaskCallback, state); }
public AsyncTaskSafeTimer(Func <object, Task> asynTaskCallback, object state) { safeTimerBase = new SafeTimerBase(asynTaskCallback, state); }
public SafeTimer(ILogger logger, TimerCallback callback, object state) { callbackFunc = callback; safeTimerBase = new SafeTimerBase(logger, callbackFunc, state); }