public bool AddOrUpdateToLater(TTimer timer, Moment time)
        {
            var timerSet = _timerSets[timer.GetHashCode() & _concurrencyLevelMask];

            return(timerSet.AddOrUpdateToLater(timer, time));
        }
        public void AddOrUpdate(TTimer timer, Moment time)
        {
            var timerSet = _timerSets[timer.GetHashCode() & _concurrencyLevelMask];

            timerSet.AddOrUpdate(timer, time);
        }
示例#3
0
 public static Task DelayAsync(this IMomentClock clock, Moment dueAt, CancellationToken cancellationToken = default)
 => clock.DelayAsync((dueAt - clock.Now).NonNegative(), cancellationToken);
示例#4
0
 public void Deconstruct(out T value, out Moment moment)
 {
     value  = Value;
     moment = Moment;
 }
示例#5
0
 public Event(T value, Moment moment)
 {
     Value  = value;
     Moment = moment;
 }
示例#6
0
        private long GetPriority(Moment time)
        {
            var priority = (time - _start).Ticks / Quanta.Ticks;

            return(Math.Max(minPriority, priority));
        }