seize

abstract suspend fun seize(resource: Resource, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, queue: RequestQ, suspensionName: String? = null): Allocation

Requests a number of units of the indicated resource.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

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.

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 seize.

suspensionName

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


open suspend fun seize(resource: ResourceWithQ, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, suspensionName: String? = null): Allocation

Requests a number of units of the indicated resource. 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 seize.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

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.

suspensionName

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


open suspend fun seize(resource: MovableResource, seizePriority: Int = PRIORITY, queue: RequestQ, suspensionName: String? = null): Allocation
open suspend fun seize(resource: MovableResourceWithQ, seizePriority: Int = PRIORITY, suspensionName: String? = null): Allocation

Requests a number of units of the indicated movable resource.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

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.

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 seize.

suspensionName

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


abstract suspend fun seize(resourcePool: ResourcePool, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, queue: RequestQ, suspensionName: String? = null): ResourcePoolAllocation

Requests a number of units from the indicated pool of resources

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

amountNeeded

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

resourcePool

the resource pool 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.

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 seize.

suspensionName

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


open suspend fun seize(resourcePool: ResourcePoolWithQ, amountNeeded: Int = 1, seizePriority: Int = PRIORITY, suspensionName: String? = null): ResourcePoolAllocation

Requests a number of units from the indicated pool of resources 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 seize.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

amountNeeded

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

resourcePool

the resource pool 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.

suspensionName

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