Class MockDelayer

java.lang.Object
com.github.mizosoft.methanol.testing.MockDelayer
All Implemented Interfaces:
Delayer

public final class MockDelayer extends Object implements Delayer
A Delayer that delays tasks based on a MockClock's time.
  • Constructor Details

    • MockDelayer

      public MockDelayer(MockClock clock)
    • MockDelayer

      public MockDelayer(MockClock clock, boolean dispatchEagerly)
  • Method Details

    • delay

      public Future<Void> delay(Runnable task, Duration delay, Executor executor)
      Description copied from interface: Delayer
      Arranges for the task to be submitted to the given executor after the delay is evaluated.
      Specified by:
      delay in interface Delayer
    • taskCount

      public int taskCount()
    • peekEarliestFuture

      public MockDelayer.DelayedFuture peekEarliestFuture()
    • peekLatestFuture

      public MockDelayer.DelayedFuture peekLatestFuture()
    • drainQueuedTasks

      public void drainQueuedTasks(boolean ignoreRejected)