public BufferList(BufferListOptions options) { _options = options ?? throw new ArgumentNullException(nameof(options)); _autoResetEvent = new ManualResetEventSlim(false); _timer = new Timer(OnTimerElapsed, null, _options.IdleClearTtl, _options.IdleClearTtl); _mainQueue = new ConcurrentQueue <T>(); _faultQueue = new ConcurrentQueue <T>(); _isClearingRunning = false; }
/// <summary> /// Initialize a new instance of BufferList. /// </summary> /// <param name="batchingSize">Clear batching size.</param> /// <param name="clearTtl">Time to clean list when idle.</param> public BufferList(int batchingSize, TimeSpan clearTtl) : this(BufferListOptions.Simple(batchingSize, clearTtl)) { }