Interface PausableBlockingQueue4<T>

    • Method Detail

      • pause

        boolean pause()

        Pauses the queue, making calls to Queue4.next() block until resume() is called.

        Returns:
        whether or not this call changed the state of the queue.
      • resume

        boolean resume()

        Resumes the queue, releasing blocked calls to Queue4.next() that can reach a next queue item..

        Returns:
        whether or not this call changed the state of the queue.
      • isPaused

        boolean isPaused()
      • tryNext

        T tryNext()

        Returns the next element in queue if there is one available, returns null otherwise.

        This method will not never block, regardless of the queue being paused or no elements are available.

        Returns:
        next element, if available and queue not paused.