Skip to content

Commit fced179

Browse files
committed
feat: adds TimeoutExample to demo setting execution timeout
1 parent 9e893cf commit fced179

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.googlecode.aviator.example;
2+
3+
import com.googlecode.aviator.AviatorEvaluator;
4+
import com.googlecode.aviator.Options;
5+
6+
/**
7+
* An example to demo execution timeout
8+
*
9+
* @author dennis
10+
*
11+
*/
12+
public class TimeoutExample {
13+
public static void main(String[] args) {
14+
AviatorEvaluator.setOption(Options.EVAL_TIMEOUT_MS, 100);
15+
AviatorEvaluator.execute("while(true) { }");
16+
}
17+
}

0 commit comments

Comments
 (0)