Search Results for

    Show / Hide Table of Contents

    Class StableListPriorityQueue

    Priority queue implemented using a simple list with binary search for inserts. This specific implementation is cheap in terms of memory but weak in terms of performance. See http://visualstudiomagazine.com/articles/2012/11/01/priority-queues-with-c.aspx for original implementation This specific version is adapted for Envelopes only and calculates a priority of envelope.Message

    Inheritance
    object
    StableListPriorityQueue
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Akka.Util
    Assembly: Akka.dll
    Syntax
    public sealed class StableListPriorityQueue

    Constructors

    | Edit this page View Source

    StableListPriorityQueue(int, Func<object, int>)

    Creates a new priority queue.

    Declaration
    public StableListPriorityQueue(int initialCapacity, Func<object, int> priorityCalculator)
    Parameters
    Type Name Description
    int initialCapacity

    The initial capacity of the queue.

    Func<object, int> priorityCalculator

    The calculator function for assigning message priorities.

    Methods

    | Edit this page View Source

    Count()

    Counts the number of items in the priority queue.

    Declaration
    public int Count()
    Returns
    Type Description
    int

    The total number of items in the queue.

    | Edit this page View Source

    Dequeue()

    Dequeues the highest priority message at the front of the priority queue.

    Declaration
    public Envelope Dequeue()
    Returns
    Type Description
    Envelope

    The highest priority message Envelope.

    | Edit this page View Source

    Enqueue(Envelope)

    Enqueues a message into the priority queue.

    Declaration
    public void Enqueue(Envelope item)
    Parameters
    Type Name Description
    Envelope item

    The item to enqueue.

    | Edit this page View Source

    IsConsistent()

    Checks the integrity of the StableListPriorityQueue.

    Declaration
    public bool IsConsistent()
    Returns
    Type Description
    bool

    true if the list is consistent, false otherwise.

    Remarks

    WARNING: high performance impact. Call during testing only.

    | Edit this page View Source

    Peek()

    Peek at the message at the front of the priority queue.

    Declaration
    public Envelope Peek()
    Returns
    Type Description
    Envelope

    The highest priority message Envelope.

    | Edit this page View Source

    ToString()

    Converts the queue to a string representation.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of the queue.

    Overrides
    object.ToString()

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET