export const defaultQueueSize = 2048
/**
- * Priority queue node.
+ * Fixed priority queue node.
*
* @typeParam T - Type of priority queue node data.
* @internal
*/
-interface PriorityQueueNode<T> {
+export interface FixedPriorityQueueNode<T> {
data: T
priority: number
}
*/
export class FixedPriorityQueue<T> {
private start!: number
- private readonly nodeArray: Array<PriorityQueueNode<T>>
+ private readonly nodeArray: Array<FixedPriorityQueueNode<T>>
public readonly capacity: number
public size!: number
public maxSize!: number
constructor (size: number = defaultQueueSize) {
this.checkSize(size)
this.capacity = size
- this.nodeArray = new Array<PriorityQueueNode<T>>(this.capacity)
+ this.nodeArray = new Array<FixedPriorityQueueNode<T>>(this.capacity)
this.clear()
}
export type { CircularBuffer } from './circular-buffer.js'
+export type {
+ FixedPriorityQueue,
+ FixedPriorityQueueNode
+} from './fixed-priority-queue.js'
export type { AbstractPool } from './pools/abstract-pool.js'
export { DynamicClusterPool } from './pools/cluster/dynamic.js'
export type { ClusterPoolOptions } from './pools/cluster/fixed.js'