Exemple #1
0
            public IEnumerable <long> ProcessTime(TimeSpan diff)
            {
                if (_registeredKeys.Count == 0)
                {
                    return(Enumerable.Empty <long>());
                }

                return(_registeredKeys.SyncGet(d =>
                {
                    var timeOutCodes = new List <long>();

                    foreach (var pair in d.CachedPairs)
                    {
                        d[pair.Key] -= diff;

                        if (d[pair.Key] > TimeSpan.Zero)
                        {
                            continue;
                        }

                        timeOutCodes.Add(pair.Key);
                        d.Remove(pair.Key);
                    }

                    return timeOutCodes;
                }));
            }