Example #1
0
        public void EnqueueCacheItem(KuaFuEventTypes eventType, params object[] args)
        {
            lock (CacheItemQueue)
            {
                AsyncDataItem item = new AsyncDataItem()
                {
                    EventType = eventType, Args = args
                };
                int count = CacheItemQueue.Count;
                if (count > MaxCachedAsyncDataItemCount)
                {
                    for (count -= MaxCachedAsyncDataItemCount; count >= 0; count--)
                    {
                        CacheItemQueue.Dequeue();
                    }
                }

                CacheItemQueue.Enqueue(item);
            }
        }
Example #2
0
 public AsyncDataItem(KuaFuEventTypes eventType, params object[] args)
 {
     EventType = eventType;
     Args      = args;
 }