Package ghidra.async

Class AsyncTimer.Mark

java.lang.Object
ghidra.async.AsyncTimer.Mark
Enclosing class:
AsyncTimer

public class AsyncTimer.Mark extends Object
  • Field Details

    • mark

      protected final long mark
  • Constructor Details

    • Mark

      protected Mark(long mark)
  • Method Details

    • after

      public CompletableFuture<Void> after(long intervalMillis)
      Schedule a task to run when the given number of milliseconds has passed since this mark

      The method returns immediately, giving a future result. The future completes "soon after" the requested interval since the last mark passes. There is some minimal overhead, but the scheduler endeavors to complete the future as close to the given time as possible. The actual scheduled time will not precede the requested time.

      Parameters:
      intervalMillis - the interval after which the returned future completes
      Returns:
      a future that completes soon after the given interval
    • timeOut

      public <T> CompletableFuture<T> timeOut(CompletableFuture<T> future, long millis, Supplier<T> valueIfLate)
      Time a future out after the given interval
      Type Parameters:
      T - the type of the future
      Parameters:
      future - the future whose value is expected in the given interval
      millis - the time interval in milliseconds
      valueIfLate - a supplier for the value if the future doesn't complete in time
      Returns:
      a future which completes with the given futures value, or the late value if it times out.