Skip to content

๐Ÿ“Ž Utilities to aid in utilizing the ever-useful .NET structure BlockingCollection<T>

License

Notifications You must be signed in to change notification settings

Jac21/BlockingCollectionExtensions

Repository files navigation

logo

NuGet Status MIT Licence Build Status donate

๐Ÿ“Ž Utilities to aid in utilizing the ever-useful .NET structure BlockingCollection<T>

Installation

Find it on nuget!

PM> Install-Package BlockingCollectionExtensions -Version 6.0.1

API

Static Additive Utilities

/// <summary>
/// Transfer contents of a generic enumerable into a target blocking collection,
/// determine whether blocking collection should complete adding when enumerable has finished being added
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="target"></param>
/// <param name="source"></param>
/// <param name="completeAddingWhenDone"></param>
public static void AddFromEnumerable<T>(this BlockingCollection<T> target, IEnumerable<T> source,
    bool completeAddingWhenDone);
    

Static Transformative Utilities

/// <summary>
/// Coalesce a target blocking collection to a structure that implements the IProducerConsumerCollection interface
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="collection"></param>
/// <param name="millisecondsTimeout"></param>
/// <param name="cancellationToken"></param>
/// <param name="count"></param>
/// <param name="isSynchronized"></param>
/// <param name="syncRoot"></param>
/// <returns></returns>
public static IProducerConsumerCollection<T> ToProducerConsumerCollection<T>(
    this BlockingCollection<T> collection, int millisecondsTimeout, CancellationToken cancellationToken,
    int count, bool isSynchronized, object syncRoot);

About

๐Ÿ“Ž Utilities to aid in utilizing the ever-useful .NET structure BlockingCollection<T>

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages