Interface SynchronizerApi.SleepRunGet

    • Method Detail

      • sleepUntil

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

        When performing this action, the chain will ensure the given condition is met before performing the next action. 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 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 timeout)
        Adds sleeping to the action chain.

        When performing this action, the chain will ensure the given condition is met before performing the next action. 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 proceeds to perform the next action.
        Parameters:
        state - the supplier that returns true if the action chain should continue, false otherwise.
        timeout - the maximum amount of time to sleep before re-checking the condition, or null to sleep indefinitely.
        Throws:
        NullPointerException - if state is null