Package org.openrewrite
Class InMemoryExecutionContext
java.lang.Object
org.openrewrite.InMemoryExecutionContext
- All Implemented Interfaces:
ExecutionContext
-
Field Summary
Fields inherited from interface org.openrewrite.ExecutionContext
CURRENT_RECIPE, DATA_TABLES, PARENT_RECIPE, UNCAUGHT_EXCEPTION_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionInMemoryExecutionContext(Consumer<Throwable> onError) InMemoryExecutionContext(Consumer<Throwable> onError, Function<Integer, Duration> runTimeout, BiConsumer<Throwable, ExecutionContext> onTimeout) -
Method Summary
Modifier and TypeMethodDescription<T> TgetMessage(String key) getRunTimeout(int inputs) <T> TpollMessage(String key) voidputMessage(String key, @Nullable Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.ExecutionContext
addObserver, computeMessage, getMessage, getObservers, getParentRecipe, incrementAndGetUncaughtExceptionCount, pollMessage, putCurrentRecipe, putMessageInCollection, putMessageInSet, putParentRecipe
-
Constructor Details
-
InMemoryExecutionContext
public InMemoryExecutionContext() -
InMemoryExecutionContext
-
InMemoryExecutionContext
-
InMemoryExecutionContext
public InMemoryExecutionContext(Consumer<Throwable> onError, Function<Integer, Duration> runTimeout, BiConsumer<Throwable, ExecutionContext> onTimeout)
-
-
Method Details
-
putMessage
- Specified by:
putMessagein interfaceExecutionContext
-
getMessage
- Specified by:
getMessagein interfaceExecutionContext
-
pollMessage
- Specified by:
pollMessagein interfaceExecutionContext
-
getOnError
- Specified by:
getOnErrorin interfaceExecutionContext
-
getOnTimeout
- Specified by:
getOnTimeoutin interfaceExecutionContext
-
getRunTimeout
- Specified by:
getRunTimeoutin interfaceExecutionContext- Parameters:
inputs- The number of inputs to the run. Allows the duration to be scaled to the number of inputs.- Returns:
- The maximum duration a run (e.g. parse operation, recipe run) can take.
-