class Quartz::CalendarQueue(T)

Overview

A fast O(1) priority queue implementation.

See paper: Brown, Randy. 1988. “Calendar Queues: a Fast 0(1) Priority Queue Implementation for the Simulation Event Set Problem.” Communications of the ACM 31 (10): 1220–27. doi:10.1145/63039.63045.

Defined in:

quartz/priority_queues/calendar_queue.cr

Constructors

Instance Method Summary

Instance methods inherited from class Quartz::PriorityQueue(T)

clear clear, delete(priority : Duration, value : T) : T | Nil delete, empty? : Bool empty?, next_priority : Duration next_priority, peek : T peek, peek? : T | Nil peek?, pop : T pop, pop_imminents(&) pop_imminents, push(priority : Duration, value : T) push, size : Int size

Constructor methods inherited from class Quartz::PriorityQueue(T)

new(priority_queue : Symbol, &comparator : Duration, Duration, Bool -> Int32) : self
new(&)
new

Instance methods inherited from class Reference

==(other : Quartz::Any) ==

Instance methods inherited from class Object

===(other : Quartz::Any) ===

Constructor Detail

def self.new(last_priority : Quartz::Duration = Duration.new(0), bucket_count = 8, width : Quartz::Duration = Duration.new(Scale::FACTOR), &comparator : Duration, Duration, Bool -> Int32) #

[View source]

Instance Method Detail

def clear #

[View source]
def delete(priority : Duration, event : T) : T | Nil #

[View source]
def empty? : Bool #

[View source]
def inspect(io) #

[View source]
def next_priority : Duration #

[View source]
def peek : T #

[View source]
def peek? : T | Nil #

[View source]
def pop : T #

[View source]
def pop? : T | Nil #

[View source]
def print_buckets(le_than : Duration) #

[View source]
def push(priority : Duration, value : T) #

[View source]
def resize(new_size) #

Resize buckets to new_size.


[View source]
def size : Int32 #

Returns the number of events.


[View source]
def to_s(io) #

[View source]