public class Subscriptions extends Object
| Constructor and Description |
|---|
Subscriptions() |
| Modifier and Type | Method and Description |
|---|---|
static long |
add(AtomicLong requested,
long requests)
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.
|
static long |
add(long a,
long b)
Adds two long values and caps the sum at Long.MAX_VALUE.
|
static long |
produced(AtomicLong requested,
long amount)
Concurrent subtraction bound to 0, mostly used to decrement a request tracker by
the amount produced by the operator.
|
static long |
subOrZero(long a,
long b)
Cap a subtraction to 0
|
public static long add(AtomicLong requested, long requests)
requested - the AtomicLong holding the current requested valuerequests - the value to add, must be positive (not verified)public static long add(long a,
long b)
a - the first valueb - the second valuepublic static long produced(AtomicLong requested, long amount)
requested - the atomic long keeping track of requestsamount - delta to subtractpublic static long subOrZero(long a,
long b)
a - left operandb - right operandCopyright © 2021 JBoss by Red Hat. All rights reserved.