Ejemplo n.º 1
0
        public ThreadTriggeredQueueJumpingHeartbeat(Stopwatch stopwatch, QueueJumpableTaskScheduler queueJumpableTaskScheduler, DedicatedThreadHeartbeatEventSource dedicatedThreadHeartbeatEventSource)
            : base(stopwatch)
        {
            this.queueJumpableTaskScheduler = queueJumpableTaskScheduler;
            HeartbeatOn = true;

            dedicatedThreadHeartbeatEventSource.Heartbeat += (s, e) => {
                if (HeartbeatOn)
                {
                    Task.Factory.StartNew(
                        () => DoHeartbeat(),
                        CancellationToken.None,
                        TaskCreationOptions.None,
                        queueJumpableTaskScheduler.FrontOfQueue);
                }
            };
        }
Ejemplo n.º 2
0
 public BackOfQueueTaskScheduler(QueueJumpableTaskScheduler parentTaskScheduler)
 {
     this.parentTaskScheduler = parentTaskScheduler;
 }