selectRequestsByResource

Returns a list of requests that can be allocated at the current time based on the amount available in the resource. Each request that can be fully allocated until the amount available is used up is returned. The list is ordered in the same order as the RequestQ. No partial filling is permitted.

The search will select those requests that can be fully filled. This may cause skipping over of waiting requests. For example, suppose there are only 2 units left to allocate and the current request needs 3 units. The search will skip the current request and check the remaining requests until it finds the next request that needs 2 or fewer units. The search keeps selecting until all waiting requests are checked or until all available capacity is used.

Return

the list with the items ordered by the queue discipline. If no items are selected, then the returned list will be empty.

Parameters

resource

the resource to check