FirstAvailablePolicy

First-available policy. Always selects the channel with the lowest index among available channels. Equivalent to a priority policy that prefers earlier channels.

Parameters

ChannelT

the type of channel managed by the policy

Constructors

Link copied to clipboard
constructor()

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.