Class GremlinExecutor

  • All Implemented Interfaces:

    public class GremlinExecutor
    extends Object
    implements AutoCloseable
    Execute Gremlin scripts against a ScriptEngine instance. It is designed to host any JSR-223 enabled ScriptEngine and assumes such engines are designed to be thread-safe in the evaluation. Script evaluation functions return a CompletableFuture where scripts may timeout if their evaluation takes too long. The default timeout is 8000ms.

    By default, the GremlinExecutor initializes itself to use a shared thread pool initialized with four threads. This default thread pool is shared for both the task of executing script evaluations and for scheduling timeouts. It is worth noting that a timeout simply triggers the returned CompletableFuture to abort, but the thread processing the script will continue to evaluate until completion. This offers only marginal protection against run-away scripts.

    Stephen Mallette (