logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class PrefetchQueue<TKey>

    Priority-based queue for managing asset prefetch requests.
    Maintains separate queues for different priority levels and processes them in order.

    Inheritance
    object
    PrefetchQueue<TKey>
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.AssetPrefetcher.Domain.Services
    Assembly: Serenity.AssetPrefetcher.Domain.dll
    Syntax
    public class PrefetchQueue<TKey>
    Type Parameters
    Name Description
    TKey

    Type of the keys being queued

    Constructors

    PrefetchQueue()

    Declaration
    public PrefetchQueue()

    Properties

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    Total number of items across all priority queues.

    HighCount

    Declaration
    public int HighCount { get; }
    Property Value
    Type Description
    int

    Number of items in the high priority queue.

    LowCount

    Declaration
    public int LowCount { get; }
    Property Value
    Type Description
    int

    Number of items in the low priority queue.

    MidCount

    Declaration
    public int MidCount { get; }
    Property Value
    Type Description
    int

    Number of items in the normal priority queue.

    Methods

    Clear()

    Clears all queues, removing all pending prefetch requests.

    Declaration
    public void Clear()

    Enqueue(TKey, PrefetchPriority)

    Enqueues a key with the specified priority level.

    Declaration
    public void Enqueue(TKey key, PrefetchPriority p)
    Parameters
    Type Name Description
    TKey key

    The key to enqueue

    PrefetchPriority p

    Priority level determining which queue to use

    TryDequeue(out TKey)

    Attempts to dequeue the next key based on priority order (High → Normal → Low).

    Declaration
    public bool TryDequeue(out TKey key)
    Parameters
    Type Name Description
    TKey key

    The dequeued key if available, default otherwise

    Returns
    Type Description
    bool

    True if a key was dequeued, false if all queues are empty

    In this article
    © 2026 Serenity. All Rights Reserved