Class TestSubscription

    • Constructor Detail

      • TestSubscription

        public TestSubscription()
    • Method Detail

      • requested

        public long requested()
        Returns the cumulative total of n from request(long)s.
        Returns:
        the cumulative total of n from request(long)s.
      • requestedEquals

        public boolean requestedEquals​(long value)
        Test if the cumulative value of request(long) matches value. This method will take into account invalid values (e.g. 0) which may otherwise be challenging to validate with requested().
        Parameters:
        value - The invalid value to check.
        Returns:
        true if the cumulative value of request(long) matches value.
      • awaitRequestN

        public void awaitRequestN​(long amount)
                           throws java.lang.InterruptedException
        Wait until the PublisherSource.Subscription.request(long) amount exceeds amount.
        Parameters:
        amount - the amount to wait for.
        Throws:
        java.lang.InterruptedException - If this thread is interrupted while waiting.
      • awaitRequestNUninterruptibly

        public void awaitRequestNUninterruptibly​(long amount)
        Wait until the PublisherSource.Subscription.request(long) amount exceeds amount without being interrupted. This method catches an InterruptedException and discards it silently.
        Parameters:
        amount - the amount to wait for.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object