Interface SynchronizerApi.SleepRunGet

All Superinterfaces:
SynchronizerApi.Fluent, SynchronizerApi.RunGet
All Known Implementing Classes:
Synchronizer
Enclosing interface:
SynchronizerApi

public static interface SynchronizerApi.SleepRunGet extends SynchronizerApi.RunGet
  • Method Details

    • sleepUntil

      default SynchronizerApi.RunGetInvoke sleepUntil(BooleanSupplier state)
      Adds sleeping to the action chain.

      This action ensures the given condition is met before performing the next action. When this action begins, the supplier is called immediately.
      Supplier returns false:
      The chain sleeps until either another chain wakes it up. The supplier is then called again and if it still returns false, the chain resumes sleeping.
      Supplier returns true:
      The chain proceeds to perform the next action.
      Parameters:
      state - the supplier that returns true if the action chain should continue, false otherwise.
      Throws:
      NullPointerException - if state is null
    • sleepUntil

      SynchronizerApi.RunGetInvoke sleepUntil(BooleanSupplier state, Duration checkInterval)
      Adds sleeping to the action chain.

      This action ensures the given condition is met before performing the next action. When this action begins, the supplier is called immediately.
      Supplier returns false:
      The chain sleeps until either another chain wakes it up or the checkInterval has passed.

      In both cases, the supplier is then called again and if it still returns false, the chain resumes sleeping.
      Supplier returns true:
      The chain proceeds to perform the next action.
      Parameters:
      state - the supplier that returns true if the action chain should continue, false otherwise.
      checkInterval - how often the condition should be re-checked even if no wake call happens, or null for "never".
      Throws:
      NullPointerException - if state is null
    • wakeOthers

      default SynchronizerApi.Run.Invoke wakeOthers()
      Adds an action which wakes other chains.