Exemple #1
0
 private void OnFirstElementChanged(object source, KeyedPriorityQueueHeadChangedEventArgs <CallbackInfo> e)
 {
     if (this.callbackTimer != null)
     {
         this.callbackTimer.Dispose();
         this.callbackTimer = null;
     }
     if ((e.NewFirstElement != null) && (base.State == WorkflowRuntimeServiceState.Started))
     {
         this.callbackTimer = this.CreateTimerCallback(e.NewFirstElement);
     }
 }
        private void OnFirstElementChanged(object source, KeyedPriorityQueueHeadChangedEventArgs <CallbackInfo> e)
        {
            // timerQueue must have been locked by operation that caused this event to fire

            if (callbackTimer != null)
            {
                callbackTimer.Dispose();
                callbackTimer = null;
            }
            if (e.NewFirstElement != null && this.State == WorkflowRuntimeServiceState.Started)
            {
                callbackTimer = CreateTimerCallback(e.NewFirstElement);
            }
        }
 private void OnFirstElementChanged(object source, KeyedPriorityQueueHeadChangedEventArgs<TimerEventSubscription> e)
 {
     lock (locker)
     {
         ITimerService timerService = this.executor.GetService(typeof(ITimerService)) as ITimerService;
         if (e.NewFirstElement != null && executor != null)
         {
             WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, "TimerEventSubscriptionQueue: {0} Schedule Timer {1} for {2} ", instanceId, e.NewFirstElement.SubscriptionId, e.NewFirstElement.ExpiresAt);
             timerService.ScheduleTimer(executor.ProcessTimersCallback, e.NewFirstElement.WorkflowInstanceId, e.NewFirstElement.ExpiresAt, e.NewFirstElement.SubscriptionId);
         }
         if (e.OldFirstElement != null)
         {
             WorkflowTrace.Host.TraceEvent(TraceEventType.Information, 0, "TimerEventSubscriptionQueue: {0} Unschedule Timer {1} for {2} ", instanceId, e.OldFirstElement.SubscriptionId, e.OldFirstElement.ExpiresAt);
             timerService.CancelTimer(e.OldFirstElement.SubscriptionId);
         }
     }
 }
 private void OnFirstElementChanged(object source, KeyedPriorityQueueHeadChangedEventArgs <CallbackInfo> e)
 {
     lock (locker)
     {
         if (threadRunning)
         {
             return;     // ignore when a timer thread is already processing a timer request
         }
         if (callbackTimer != null)
         {
             callbackTimer.Dispose();
             callbackTimer = null;
         }
         if (e.NewFirstElement != null && this.State == WorkflowRuntimeServiceState.Started)
         {
             callbackTimer = CreateTimerCallback(e.NewFirstElement);
         }
     }
 }
 private void OnFirstElementChanged(object source, KeyedPriorityQueueHeadChangedEventArgs<CallbackInfo> e)
 {
     if (this.callbackTimer != null)
     {
         this.callbackTimer.Dispose();
         this.callbackTimer = null;
     }
     if ((e.NewFirstElement != null) && (base.State == WorkflowRuntimeServiceState.Started))
     {
         this.callbackTimer = this.CreateTimerCallback(e.NewFirstElement);
     }
 }
        private void OnFirstElementChanged(object source, KeyedPriorityQueueHeadChangedEventArgs<CallbackInfo> e)
        {
            // timerQueue must have been locked by operation that caused this event to fire

            if (callbackTimer != null)
            {
                callbackTimer.Dispose();
                callbackTimer = null;
            }
            if (e.NewFirstElement != null && this.State == WorkflowRuntimeServiceState.Started)
            {
                callbackTimer = CreateTimerCallback(e.NewFirstElement);
            }
        }
 private void OnFirstElementChanged(object source, KeyedPriorityQueueHeadChangedEventArgs<CallbackInfo> e)
 {
     lock (locker)
     {
         if (threadRunning)
             return;     // ignore when a timer thread is already processing a timer request
         if (callbackTimer != null)
         {
             callbackTimer.Dispose();
             callbackTimer = null;
         }
         if (e.NewFirstElement != null && this.State == WorkflowRuntimeServiceState.Started)
         {
             callbackTimer = CreateTimerCallback(e.NewFirstElement);
         }
     }
 }