requestConveyor

abstract suspend fun requestConveyor(conveyor: Conveyor, entryLocation: IdentityIfc, numCellsNeeded: Int = 1, requestPriority: Int = PRIORITY, requestResumePriority: Int = PRIORITY, suspensionName: String? = null): ConveyorRequestIfc

This suspending function requests the number of cells indicated at the entry location of the conveyor. If the number of cells are not immediately available the process is suspended until the number of cells can be allocated (in full). The request for the cells will wait for the allocation in the queue associated with the start of the segment associated with the entry location of the conveyor. After this suspending function returns, the entity holds the cells in the returned cell allocation, but the entity is not on the conveyor. The entity can then decide to ride on the conveyor using the cell allocation or release the cell allocation by exiting the conveyor without riding. The behavior of the conveyor during access is governed by the type of conveyor. A blockage occurs at the entry point of the segment while the entity has the allocated cells and before exiting or riding.

Return

a representation of the allocated cells on the conveyor. The user should use this as a ticket to ride on the conveyor and to eventually release the allocated cells by exiting the conveyor.

Parameters

conveyor

the conveyor to access

entryLocation

the location on the conveyor at which the cells are requested

numCellsNeeded

the number of cells needed (requested)

requestPriority

the priority of the access. If there are multiple entities that access the conveyor at the same time this priority determines which goes first. Similar to the seize resource priority.

suspensionName

the name of the suspension point the entity is experiencing if there are more than one delay suspension points within the process. The user is responsible for uniqueness.