MostFullJoinPolicy

class MostFullJoinPolicy<T>(tags: Iterable<InputTag<Container<*>>> = generateSequence { newDynamicInputTag { it.walkUpstream().filterIsInstance<Container<*>>().first() } } .asIterable()) : JoinPolicy<T>

Join policy that pulls from the source with the highest occupancy. Helps balance load by pulling from the busiest source.

Parameters

T

the type of entities being merged

tags

the tags used to identify upstream containers for each source

Constructors

Link copied to clipboard
constructor(tags: Iterable<InputTag<Container<*>>> = generateSequence { newDynamicInputTag { it.walkUpstream().filterIsInstance<Container<*>>().first() } } .asIterable())

Functions

Link copied to clipboard
context(_: Simulator)
open override fun initialize(sources: List<PullInputChannel<T>>, destination: PullOutputChannel<T>)

Initializes the policy with the source and destination channels. Sets up initial state and event listeners for channel readiness events.

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

Checks if no source channels are ready.

Link copied to clipboard
open override fun onChannelNotReady(channel: PullInputChannel<T>)

Called when a source channel is no longer ready (has no data available).

Link copied to clipboard
open override fun onChannelReady(channel: PullInputChannel<T>)

Called when a source channel becomes ready (has data available).

Link copied to clipboard
open override fun selectChannel(): PullInputChannel<T>

Selects the source channel to pull from.