syncWith

open suspend fun syncWith(entityToSyncWith: ProcessModel.Entity, queue: HoldQueue, priority: Int = entity.priority, resumePriority: Int = RESUME_PRIORITY, waitStats: Boolean = true, suspensionName: String? = null)(source)

Causes the entity to place itself in the hold queue if the entity to sync with is not within the hold queue. If the entity to sync with is in the hold queue, then the active entity will cause the held entity to resume at the curren time. This function facilitates a common use case between entities to allow them to sync in time.

Parameters

queue

a queue to hold the waiting entities

priority

the priority for the queue discipline. The default is the entity's own priority. A priority supplied here is written to the entity and stays after the suspension.

resumePriority

the priority for the resumption of the suspended process

waitStats

if true the waiting time statistics are collected on the usage of the queue

suspensionName

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