QueuePolicy

interface QueuePolicy<T>

Policy for managing queue behavior. Determines how entities are stored and retrieved from a queue. Implementations can provide different ordering strategies (FIFO, priority, random, etc.).

Parameters

T

the type of entities in the queue

Inheritors

Properties

Link copied to clipboard
abstract val contents: Sequence<T>

A sequence of all entities currently in the queue, in their stored order.

Functions

Link copied to clipboard
abstract fun dequeue(): T

Removes and returns an entity from the queue according to the policy.

Link copied to clipboard
abstract fun enqueue(obj: T)

Adds an entity to the queue according to the policy.

Link copied to clipboard
abstract fun reportOccupancy(): Int

Reports the current number of entities in the queue.

Link copied to clipboard

Indicates whether this policy supports residence time tracking for entities.