TokenQueuePolicy

Token queue policy. Manages a pool of abstract tokens used for flow control. Rather than storing actual entities, tracks token availability. Does not support residence time tracking since tokens are not individual entities.

Parameters

count

the initial number of tokens available

Constructors

Link copied to clipboard
constructor(count: Int)

Properties

Link copied to clipboard
open override val contents: Sequence<Token>

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

Functions

Link copied to clipboard
open override fun dequeue(): Token

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

Link copied to clipboard
open override fun enqueue(obj: Token)

Adds an entity to the queue according to the policy.

Link copied to clipboard
open override fun reportOccupancy(): Int

Reports the current number of entities in the queue.

Link copied to clipboard
open override fun supportsResidenceTime(): Boolean

Indicates whether this policy supports residence time tracking for entities.