public abstract static class Publisher.OrderBy<V> extends Object implements Publisher.Option<V>, ExternalizableLite, PortableObject
thread()
which ensures
that a sequence of async operations issued by a single thread will complete
in order. This default ordering does not however guarantee ordering with
respect to other threads or processes which are also issuing operations
against the same topic. To ensure strict global ordering across threads or
processes all parties must specify
the same unit-of-order id.
Note that restricting the topic to a single unit-of-order naturally limits
performance as it disallows full parallelism.Modifier | Constructor and Description |
---|---|
protected |
OrderBy()
Default constructor for serialization.
|
Modifier and Type | Method and Description |
---|---|
abstract int |
getOrderId(V value)
Return unit-of-order id.
|
static Publisher.OrderBy<Object> |
id(int nOrderId)
Return an OrderBy that will ensure ordering of
sent values across
all threads which share the same id. |
static Publisher.OrderBy<Object> |
none()
Return an OrderBy that will enforce no specific ordering between
sent values allowing for the greatest level of parallelism. |
static Publisher.OrderBy<Object> |
thread()
Return an OrderBy that will ensure that all
values sent from
the same thread are stored sequentially. |
static <V> Publisher.OrderBy<V> |
value(Remote.ToIntFunction<? super V> supplierOrderId)
Return an OrderBy which will compute the unit-of-order based on the
sent value . |
static <V> Publisher.OrderBy<V> |
value(ToIntFunction<? super V> supplierOrderId)
Return an OrderBy which will compute the unit-of-order based on the
sent value . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readExternal, writeExternal
readExternal, writeExternal
public abstract int getOrderId(V value)
@Options.Default public static Publisher.OrderBy<Object> thread()
values sent
from
the same thread are stored sequentially.public static Publisher.OrderBy<Object> none()
sent values
allowing for the greatest level of parallelism.public static Publisher.OrderBy<Object> id(int nOrderId)
sent values
across
all threads which share the same id.nOrderId
- the unit-of-ordernOrderId
for all
operationspublic static <V> Publisher.OrderBy<V> value(Remote.ToIntFunction<? super V> supplierOrderId)
sent value
.supplierOrderId
- the function that should be used to determine
order id from the sent value.public static <V> Publisher.OrderBy<V> value(ToIntFunction<? super V> supplierOrderId)
sent value
.supplierOrderId
- the function that should be used to determine
order id from the sent value.