| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static long | Returns: the original value before the addthe AtomicLong holding the current requested value requested, long the value to add, must be positive (not verified) n)Atomically adds the positive value n to the requested value in the AtomicLong and caps the result at Long.MAX_VALUE and returns the previous value. |
| public static long | Returns: the original value before the addthe AtomicLong holding the current requested value requested, long the value to add, must be positive (not verified) n)Atomically adds the positive value n to the requested value in the AtomicLong and caps the result at Long.MAX_VALUE and returns the previous value and considers Long.MIN_VALUE as a cancel indication (no addition then). |
| public static long | Returns: the sum capped at Long.MAX_VALUEthe first value a, long the second value b)Adds two long values and caps the sum at Long.MAX_VALUE. |
| public static long | Returns: the product capped at Long.MAX_VALUEthe first value a, long the second value b)Multiplies two long values and caps the product at Long.MAX_VALUE. |
| public static long | Returns: the new amountthe target field holding the current requested amount requested, long the produced element count, positive (not validated) n)Atomically subtract the given number (positive, not validated) from the target field unless it contains Long.MAX_VALUE. |
| public static long | Returns: the new amountthe target field holding the current requested amount requested, long the produced element count, positive (not validated) n)Atomically subtract the given number (positive, not validated) from the target field if it doesn't contain Long.MIN_VALUE (indicating some cancelled state) or Long.MAX_VALUE (unbounded mode). |
| BackpressureHelper | back to summary |
|---|---|
| private BackpressureHelper() Utility class. | |
| add | back to summary |
|---|---|
| public static long add(AtomicLong requested, long n) Atomically adds the positive value n to the requested value in the AtomicLong and caps the result at Long.MAX_VALUE and returns the previous value.
| |
| addCancel | back to summary |
|---|---|
| public static long addCancel(AtomicLong requested, long n) Atomically adds the positive value n to the requested value in the AtomicLong and caps the result at Long.MAX_VALUE and returns the previous value and considers Long.MIN_VALUE as a cancel indication (no addition then).
| |
| addCap | back to summary |
|---|---|
| public static long addCap(long a, long b) Adds two long values and caps the sum at Long.MAX_VALUE.
| |
| multiplyCap | back to summary |
|---|---|
| public static long multiplyCap(long a, long b) Multiplies two long values and caps the product at Long.MAX_VALUE.
| |
| produced | back to summary |
|---|---|
| public static long produced(AtomicLong requested, long n) Atomically subtract the given number (positive, not validated) from the target field unless it contains Long.MAX_VALUE.
| |
| producedCancel | back to summary |
|---|---|
| public static long producedCancel(AtomicLong requested, long n) Atomically subtract the given number (positive, not validated) from the target field if it doesn't contain Long.MIN_VALUE (indicating some cancelled state) or Long.MAX_VALUE (unbounded mode).
| |