function TimerQueue::heapifyUp
Parameters
int $node Rebuild the data array from the given node upward.:
2 calls to TimerQueue::heapifyUp()
- TimerQueue::insert in vendor/
revolt/ event-loop/ src/ EventLoop/ Internal/ TimerQueue.php - Inserts the callback into the queue.
- TimerQueue::removeAndRebuild in vendor/
revolt/ event-loop/ src/ EventLoop/ Internal/ TimerQueue.php
File
-
vendor/
revolt/ event-loop/ src/ EventLoop/ Internal/ TimerQueue.php, line 92
Class
- TimerQueue
- Uses a binary tree stored in an array to implement a heap.
Namespace
Revolt\EventLoop\InternalCode
private function heapifyUp(int $node) : void {
$entry = $this->callbacks[$node];
while ($node !== 0 && $entry->expiration < $this->callbacks[$parent = $node - 1 >> 1]->expiration) {
$this->swap($node, $parent);
$node = $parent;
}
}