Reserves the resource with the specified amount, with the specified time-out.
Namespace: AGI.Parallel.Infrastructure
Assembly: AGI.Parallel.Infrastructure (in AGI.Parallel.Infrastructure.dll) Version: 1.2.0.275 (1.2.0.275)

Syntax

C#
long ReserveResource(
        string resource,
        long amount,
        int millisecondsTimeout
)
Visual Basic
Function ReserveResource ( _
        resource As String, _
        amount As Long, _
        millisecondsTimeout As Integer _
) As Long

Parameters

resource
Type: System..::..String
The resource. You can find common values for resources using ConsumableResources.
amount
Type: System..::..Int64
The amount.
millisecondsTimeout
Type: System..::..Int32
The number of milliseconds to wait, or System.Threading.Timeout.Infinite (-1) to wait indefinitely.

Return Value

The resource amount currently consumed by the task.

Remarks

Blocks until the resource becomes available or the time-out expires. If the time-out expires a JobSchedulerException is thrown.

Exceptions

Exception Condition
System..::..ArgumentNullException If resource is null.
System..::..ArgumentOutOfRangeException If amount if less than 0.
AGI.Parallel.Client..::..JobSchedulerException If error occurred during operation. For instance, there were not enough resources to satisfy reserve request.

See Also