abstract class AvalancheMQ::Queue::SortedReadyQueue

Direct Known Subclasses

Defined in:

avalanchemq/queue/ready.cr

Instance Method Summary

Instance methods inherited from class AvalancheMQ::Queue::ReadyQueue

<<(sp) <<, [](idx) [], []?(idx) []?, bsearch_index(&) bsearch_index, capacity capacity, compact compact, delete(sp) : Bool delete, each(start : Int, count : Int, &)
each(&)
each
, empty? empty?, first? first?, includes?(sp) includes?, insert(sp : SegmentPosition)
insert(sps : Enumerable(SegmentPosition))
insert
, limit_byte_size(bytesize, &blk : SegmentPosition -> Nil) limit_byte_size, limit_size(size, &blk : SegmentPosition -> Nil) limit_size, lock lock, locked_each(&) locked_each, purge purge, push(sp : SegmentPosition) : Int32 push, shift
shift(&blk : SegmentPosition -> Bool)
shift
, shift? shift?, size size, sum(&blk : SegmentPosition -> _) : UInt64 sum, to_a to_a, unlock unlock, with_all(&blk : Iterator(SegmentPosition) -> Nil) with_all

Constructor methods inherited from class AvalancheMQ::Queue::ReadyQueue

new(inital_capacity = 1024) new

Instance Method Detail

def insert(sp : SegmentPosition) #
Description copied from class AvalancheMQ::Queue::ReadyQueue

insert a SP, keeps the deque sorted returns SPs in the deque after the operation


[View source]
def insert(sps : Enumerable(SegmentPosition)) #

Insert SPs sorted, the array should ideally be sorted too


[View source]
def push(sp : SegmentPosition) : Int32 #
Description copied from class AvalancheMQ::Queue::ReadyQueue

Pushes a SP to the end of the deque Returns number of SPs in the deque


[View source]