Class Publisher.OrderBy<V>

    • Constructor Detail

      • OrderBy

        protected OrderBy()
        Default constructor for serialization.
    • Method Detail

      • getOrderId

        public abstract int getOrderId​(V value)
        Return unit-of-order id.
        Returns:
        the unit-of-order id
      • thread

        @Default
        public static Publisher.OrderBy<Object> thread()
        Return an OrderBy that will ensure that all values sent from the same thread are stored sequentially.
        Returns:
        the default, thread-based ordering
      • none

        public static Publisher.OrderBy<Object> none()
        Return an OrderBy that will enforce no specific ordering between sent values allowing for the greatest level of parallelism.
        Returns:
        the OrderBy which does not enforce ordering
      • id

        public 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.

        This option effectively publishes all messages to a single channel, the exact channel used is the specified nOrderId modulo the number of channels in the topic. Therefore a channel number can be used as the nOrderId parameter to ensure publishing to a specific channel.

        Parameters:
        nOrderId - the unit-of-order
        Returns:
        the order which will use specified nOrderId for all operations
      • value

        public 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.
        Parameters:
        supplierOrderId - the function that should be used to determine order id from the sent value.
        Returns:
        the order which will use specified function to provide unit-of-order for each async operation
      • value

        public 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.
        Parameters:
        supplierOrderId - the function that should be used to determine order id from the sent value.
        Returns:
        the order which will use specified function to provide unit-of-order for each async operation
      • roundRobin

        public static <V> Publisher.OrderBy<V> roundRobin()
        Return an OrderBy which will compute the unit-of-order such that each message is published to the next channel in a round robin order.
        Returns:
        an OrderBy which will compute the unit-of-order such that each message is published to the next channel in a round robin order.