Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 /// <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))
 {
 }