Package org.apache.polaris.nosql.async
Class MockAsyncExec
java.lang.Object
org.apache.polaris.nosql.async.MockAsyncExec
- All Implemented Interfaces:
org.apache.polaris.nosql.async.AsyncExec
An
AsyncExec implementation used in tests that need to verify the interaction with AsyncExec. Execution of submitted tasks needs to be manually triggered by the tests that use
this class.
This implementation is best used in combination with MutableMonotonicClock to allow
assertions on scheduled/execution timestamps.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordfinal class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnextReadyAt(Instant at) longlongreadyCount(Instant at) <R> org.apache.polaris.nosql.async.Cancelable<R> org.apache.polaris.nosql.async.Cancelable<Void> schedulePeriodic(Runnable runnable, Duration initialDelay, Duration delay) tasks()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.polaris.nosql.async.AsyncExec
schedule, schedulePeriodic, submit
-
Constructor Details
-
MockAsyncExec
public MockAsyncExec(org.apache.polaris.ids.api.MonotonicClock clock)
-
-
Method Details
-
tasks
-
nextReady
-
nextReadyAt
-
readyCount
public long readyCount() -
readyCount
-
readyCallables
-
schedulePeriodic
public org.apache.polaris.nosql.async.Cancelable<Void> schedulePeriodic(Runnable runnable, Duration initialDelay, Duration delay) - Specified by:
schedulePeriodicin interfaceorg.apache.polaris.nosql.async.AsyncExec
-
schedule
public <R> org.apache.polaris.nosql.async.Cancelable<R> schedule(Callable<R> callable, Duration delay) - Specified by:
schedulein interfaceorg.apache.polaris.nosql.async.AsyncExec
-