Package org.neo4j.jdbc.utils
Class TimeLimitedCodeBlock
- java.lang.Object
-
- org.neo4j.jdbc.utils.TimeLimitedCodeBlock
-
public class TimeLimitedCodeBlock extends Object
- Since:
- 3.0.0
- Author:
- AgileLARUS
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidrunWithTimeout(Runnable runnable, long timeout, TimeUnit timeUnit)This method is used to run a specificRunnablefor at most atimeoutperiod of time.
-
-
-
Method Detail
-
runWithTimeout
public static void runWithTimeout(Runnable runnable, long timeout, TimeUnit timeUnit)
This method is used to run a specificRunnablefor at most atimeoutperiod of time. If atimeoutof 0 is set then no timeout will be applied.- Parameters:
runnable- The runnable to runtimeout- The maximum time a run should lasttimeUnit- TheTimeUnitunit for the timeout- Throws:
Neo4jJdbcRuntimeException- Any exception thrown by the runnable wrapped.
-
-