moveRequestToResource

protected fun moveRequestToResource(request: ProcessModel.Entity.ResourceRequest, currentQueue: RequestQ, resource: ResourceWithQ, resumePriority: Int, waitStats: Boolean = false)(source)

A request, in a request queue, is there because it's entity is suspended. This function will remove the supplied request from the specified queue and place it in the queue associated with the specified resource. If the resource has units of capacity available to satisfy the request, then the entity is resumed to allow the units to be allocated. If the resource does not have sufficient units to satisfy the request, the entity stays suspended within the resource's queue and will be processed as a normal request for the resource.

The specified resource must not be associated with the request. The request must be queued and in the specified queue. The entity must currently be suspended and must be associated with the supplied request. The request must be for a resource to be moved to a resource with a queue.

Parameters

request

the request to move

currentQueue

the queue that the request is currently in

resource

the new resource that the request to be for

resumePriority

the priority of the resume if the request can be resumed

waitStats

indicated whether the removal of the request from its current queue will cause waiting time statistics to be collected for that queue. The default is false.