Class CallableWithTimeout
java.lang.Object
fr.inria.rules.integraal.util.timeout.CallableWithTimeout
A utility class to execute a Callable with a specified timeout.
If the timeout expires before the Callable completes, it returns null.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CallableWithTimeout
public CallableWithTimeout()Creates the timeout helper utility.
-
-
Method Details
-
execute
Executes a Callable with a specified timeout.- Type Parameters:
T- The result type returned by the callable.- Parameters:
task- The Callable to execute.timeout- The duration of the timeout ; must not be null;- Returns:
- The result of the Callable, or null if the timeout expires.
-