PriorityPolicy

Priority policy. Selects the channel with the highest priority according to the provided comparator.

Parameters

ChannelT

the type of channel managed by the policy

comparator

the Comparator that defines channel priorities

Inheritors

Constructors

Link copied to clipboard
constructor(comparator: Comparator<Int>)

Functions

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

Checks if all channels are unavailable.

Link copied to clipboard
context(_: Simulator)
open override fun initialize(channels: List<ChannelT>)

Initializes the policy with the list of channels it will manage.

Link copied to clipboard
open override fun onChannelAvailable(channel: ChannelT)

Called when a channel becomes available (open for fork, ready for join).

Link copied to clipboard
open override fun onChannelUnavailable(channel: ChannelT)

Called when a channel becomes unavailable (closed for fork, not ready for join).

Link copied to clipboard
open override fun selectChannel(): ChannelT

Selects a channel from the available channels.