mk.helpers
Search Results for

    Show / Hide Table of Contents

    Class QueueExtensions

    Provides extension methods for working with queues.

    Inheritance
    object
    QueueExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: mk.helpers
    Assembly: mk.helpers.dll
    Syntax
    public static class QueueExtensions

    Methods

    DequeueChunk<T>(ConcurrentQueue<T>, int)

    Dequeues a chunk of items from a ConcurrentQueue<T> with the specified chunk size.

    Declaration
    public static List<T> DequeueChunk<T>(this ConcurrentQueue<T> queue, int chunkSize)
    Parameters
    Type Name Description
    ConcurrentQueue<T> queue

    The concurrent queue from which to dequeue.

    int chunkSize

    The number of items to dequeue in each chunk.

    Returns
    Type Description
    List<T>

    A list containing the dequeued items.

    Type Parameters
    Name Description
    T

    The type of elements in the queue.

    DequeueChunk<T>(Queue<T>, int)

    Dequeues a chunk of items from a Queue<T> with the specified chunk size.

    Declaration
    public static IEnumerable<T> DequeueChunk<T>(this Queue<T> queue, int chunkSize)
    Parameters
    Type Name Description
    Queue<T> queue

    The queue from which to dequeue.

    int chunkSize

    The number of items to dequeue in each chunk.

    Returns
    Type Description
    IEnumerable<T>

    An enumerable containing the dequeued items.

    Type Parameters
    Name Description
    T

    The type of elements in the queue.

    In this article
    Back to top mk.helpers - MIT License