waitForItems

abstract suspend fun <T : ModelElement.QObject> waitForItems(blockingQ: BlockingQueue<T>, amount: Int = 1, predicate: (T) -> Boolean = alwaysTrue, blockingPriority: Int = PRIORITY, suspensionName: String? = null): List<T>

This method will block (suspend) until the required number of items that meet the criteria become available within the blocking queue.

Parameters

blockingQ

the blocking queue channel that has the items

amount

the number of items needed from the blocking queue that match the criteria

predicate

a functional predicate that tests items in the queue for the criteria

blockingPriority

the priority associated with the entity if it has to wait to receive

suspensionName

the name of the suspension point. can be used to identify which receive suspension point the entity is experiencing if there are more than one receive suspension points within the process. The user is responsible for uniqueness.