class AvalancheMQ::Queue::ReadyQueue
- AvalancheMQ::Queue::ReadyQueue
- Reference
- Object
Overview
ReadyQueue is a sorted Deque of SegmentPositions
Direct Known Subclasses
Defined in:
avalanchemq/queue/ready.crConstructors
Instance Method Summary
-
#<<(sp)
alias for
#push
- #[](idx)
- #[]?(idx)
- #bsearch_index(&)
- #capacity
- #compact
-
#delete(sp) : Bool
Deletes a SP somewhere in the deque returns true/false whether found
- #each(start : Int, count : Int, &)
-
#each(&)
Iterate over all SPs in the deque, locking while reading
- #empty?
- #first?
- #includes?(sp)
-
#insert(sp : SegmentPosition)
insert a SP, keeps the deque sorted returns SPs in the deque after the operation
-
#insert(sps : Enumerable(SegmentPosition))
Insert SPs sorted, the array should ideally be sorted too
- #limit_byte_size(bytesize, &blk : SegmentPosition -> Nil)
- #limit_size(size, &blk : SegmentPosition -> Nil)
- #lock
- #locked_each(&)
-
#purge
yields all messages, then clears it returns number of messages in the queue before purge
-
#push(sp : SegmentPosition) : Int32
Pushes a SP to the end of the deque Returns number of SPs in the deque
- #shift
-
#shift(&blk : SegmentPosition -> Bool)
Shift until block breaks or it returns false If broken with false yield, return the message to the queue
- #shift?
- #size
- #sum(&blk : SegmentPosition -> _) : UInt64
- #to_a
- #unlock
-
#with_all(&blk : Iterator(SegmentPosition) -> Nil)
Yields an iterator over all SPs, the deque is locked while it's being read from
Constructor Detail
Instance Method Detail
insert a SP, keeps the deque sorted returns SPs in the deque after the operation
Insert SPs sorted, the array should ideally be sorted too
yields all messages, then clears it returns number of messages in the queue before purge
Pushes a SP to the end of the deque Returns number of SPs in the deque
Shift until block breaks or it returns false If broken with false yield, return the message to the queue
Yields an iterator over all SPs, the deque is locked while it's being read from