Skip to content

Commit

Permalink
feat: made sure feel-interpreter's evaluation method can be interrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmosin committed Apr 18, 2024
1 parent d20bc24 commit 8883e86
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ import java.time.{Duration, Period}
*/
class FeelInterpreter {

def eval(expression: Exp)(implicit context: EvalContext): Val =
def eval(expression: Exp)(implicit context: EvalContext): Val = {
if (Thread.interrupted()) {
throw new InterruptedException()
}

expression match {

// literals
Expand Down Expand Up @@ -269,6 +273,7 @@ class FeelInterpreter {
case exp => error(EvaluationFailureType.UNKNOWN, s"Unsupported expression '$exp'")

}
}

private def mapEither[T, R](
it: Iterable[T],
Expand Down

0 comments on commit 8883e86

Please sign in to comment.