Class WaitNotification

java.lang.Object
com.illumon.iris.db.v2.utils.AbstractNotification
com.illumon.iris.db.tables.live.WaitNotification
All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, NotificationQueue.Notification, IntrusiveDoublyLinkedNode<NotificationQueue.Notification>, Runnable

public final class WaitNotification
extends AbstractNotification
One-shot NotificationQueue.Notification that can be delivered when a set of dependencies are satisfied. This allows for an external observer to wait for multiple dependencies to be satisfied using waitForSatisfaction(long, NotificationQueue.Dependency...).
  • Method Details

    • canExecute

      public boolean canExecute​(long step)
      Description copied from interface: NotificationQueue.Notification
      Can this notification be executed? That is, are all of it's dependencies satisfied.
      Parameters:
      step - The step for which we are testing satisfaction
      Returns:
      true if this notification can be executed, false if it has unmet dependencies
    • append

      public com.fishlib.base.log.LogOutput append​(com.fishlib.base.log.LogOutput logOutput)
      Specified by:
      append in interface com.fishlib.base.log.LogOutputAppendable
      Overrides:
      append in class AbstractNotification
    • run

      public void run()
    • waitForSatisfaction

      public static boolean waitForSatisfaction​(long step, @NotNull NotificationQueue.Dependency... dependencies)
      Wait for all of the specified dependencies to be satisfied on the specified step.
      Parameters:
      step - The step to wait for satisfaction on
      dependencies - The dependencies to wait for
      Returns:
      True if the dependencies became satisfied on the specified step, false if the cycle had already completed