public T Dequeue <T>()
        {
            var type = typeof(T);

            if (!slots.ContainsKey(type))
            {
                throw new Exception("!slots.ContainsKey( type )");
            }

            var item = slots[type].Dequeue();

            DequeueEvent?.Invoke(type, new QueueEventArgs(item));
            return(item);
        }
Example #2
0
        public T Dequeue()
        {
            if (Count == 0)
            {
                throw new InvalidOperationException();
            }
            T local = _array[_head];

            _array[_head] = default(T);
            _head         = (_head + 1) % _array.Length;
            Count--;
            _version++;

            DequeueEvent?.Invoke(this, new MyQueueEventArgs <T>("Event from Dequeue", local));

            return(local);
        }
Example #3
0
 public static void OnDequeue(IEnumerable <IAwsArgs> args)
 {
     DequeueEvent?.Invoke(GetInstance(), args);
 }