use

open suspend fun use(resource: Resource, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, delayDuration: Double, delayPriority: Int = PRIORITY, queue: RequestQ)
open suspend fun use(resource: Resource, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, delayDuration: GetValueIfc, delayPriority: Int = PRIORITY, queue: RequestQ)

Uses the resource with the amount of units for the delay and then releases it. Equivalent to: seize(), delay(), release()

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resource

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

delayDuration

, the length of time required before the process continues executing, must not be negative and must be finite.

delayPriority

, since the delay is scheduled, a priority can be used to determine the order of events for delays that might be scheduled to complete at the same time.

queue

the queue that will hold the entity if the amount needed cannot immediately be supplied by the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling use.


open suspend fun use(resource: ResourceWithQ, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, delayDuration: Double, delayPriority: Int = PRIORITY)
open suspend fun use(resource: ResourceWithQ, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, delayDuration: GetValueIfc, delayPriority: Int = PRIORITY)

Uses the resource with the amount of units for the delay and then releases it. Equivalent to: seize(), delay(), release() The queue that will hold the entity is internal to the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling use.

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resource

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

delayDuration

, the length of time required before the process continues executing, must not be negative and must be finite.

delayPriority

, since the delay is scheduled, a priority can be used to determine the order of events for delays that might be scheduled to complete at the same time.


open suspend fun use(resourcePool: ResourcePool, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, delayDuration: Double, delayPriority: Int = PRIORITY, queue: RequestQ)

Uses the resource with the amount of units for the delay and then releases it. Equivalent to: seize(), delay(), release()

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resourcePool

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

delayDuration

, the length of time required before the process continues executing, must not be negative and must be finite.

delayPriority

, since the delay is scheduled, a priority can be used to determine the order of events for delays that might be scheduled to complete at the same time.

queue

the queue that will hold the entity if the amount needed cannot immediately be supplied by the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling use.


open suspend fun use(resourcePool: ResourcePoolWithQ, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, delayDuration: Double, delayPriority: Int = PRIORITY)
open suspend fun use(resourcePool: ResourcePoolWithQ, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, delayDuration: GetValueIfc, delayPriority: Int = PRIORITY)

Uses the resource with the amount of units for the delay and then releases it. Equivalent to: seize(), delay(), release() The queue that will hold the entity is internal to the resource pool. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling use.

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resourcePool

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

delayDuration

, the length of time required before the process continues executing, must not be negative and must be finite.

delayPriority

, since the delay is scheduled, a priority can be used to determine the order of events for delays that might be scheduled to complete at the same time.