Interface SynchronizerApi.Get.SleepInvoke<T>

    • Method Detail

      • thenSleepUntil

        default SynchronizerApi.Get.Invoke<T> thenSleepUntil​(BooleanSupplier state)
        Description copied from interface: SynchronizerApi.Base.SleepInvoke
        Adds sleeping to the action chain.

        When performing this action, the chain will ensure the given condition is met before returning. If the supplier returns false, this action chain sleeps until another chain wakes it up. Then, the supplier is called again and if it still returns false, the chain resumes sleeping. Otherwise, the chain invocation finishes.
        Specified by:
        thenSleepUntil in interface SynchronizerApi.Base.SleepInvoke
        Parameters:
        state - the supplier that returns true if the action chain should finish, false otherwise.
      • thenSleepUntil

        SynchronizerApi.Get.Invoke<T> thenSleepUntil​(BooleanSupplier state,
                                                     Duration timeout)
        Description copied from interface: SynchronizerApi.Base.SleepInvoke
        Adds sleeping to the action chain.

        When performing this action, the chain will ensure the given condition is met before returning. If the supplier returns false, this action chain sleeps until either another chain wakes it up or the timeout has passed. Then, the supplier is called again and if it still returns false, the chain resumes sleeping. Otherwise, the chain invocation finishes.
        Specified by:
        thenSleepUntil in interface SynchronizerApi.Base.SleepInvoke
        Parameters:
        state - the supplier that returns true if the action chain should finish, false otherwise.
        timeout - the maximum amount of time to sleep before re-checking the condition, or null to sleep indefinitely.