public ConsumingEnumerator(AsyncBlockingCollection <T> collection, CancellationToken cancellation) { m_collection = collection; m_disposeToken = cancellation.CanBeCanceled ? CancellationTokenSource.CreateLinkedTokenSource(cancellation) : new CancellationTokenSource(); }
/// <summary> /// 创建枚举器 /// </summary> /// <param name="collection"></param> public ConsumingEnumerable(AsyncBlockingCollection <T> collection) { m_collection = collection ?? throw new ArgumentNullException(nameof(collection)); }