Class MultiItemCombineIterable

    • Constructor Summary

      Constructors 
      Constructor Description
      MultiItemCombineIterable​(java.lang.Iterable<? extends java.util.concurrent.Flow.Publisher<?>> iterable)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MultiItemCombineIterable collectFailures()
      Configures the combination to wait until all the streams to fire a completion or failure event before propagating a failure downstream.
      MultiItemCombineIterable latestItems()
      By default, the combination logic is called with one item of each observed stream.
      <O> Multi<O> using​(java.util.function.Function<java.util.List<?>,​O> combinator)
      Sets the combination logic as parameter and returns a Multi associating the items from the observed stream using this combinator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiItemCombineIterable

        public MultiItemCombineIterable​(java.lang.Iterable<? extends java.util.concurrent.Flow.Publisher<?>> iterable)
    • Method Detail

      • collectFailures

        @CheckReturnValue
        public MultiItemCombineIterable collectFailures()
        Configures the combination to wait until all the streams to fire a completion or failure event before propagating a failure downstream.
        Returns:
        the current MultiItemCombineIterable
      • latestItems

        @CheckReturnValue
        public MultiItemCombineIterable latestItems()
        By default, the combination logic is called with one item of each observed stream. It waits until all the upstreams emit an item, and it invokes the combination logic. In other words, it associated the items from different streams having the same index. If one of the streams completes, the produced stream also completes.

        With this method, you can change this behavior and call the combination logic when one of the observed streams emits an item. It calls the combination logic with this new item and the latest items emitted by the other streams.

        It waits until all the streams have emitted at least one item before calling the combination logic. If one of the streams completes before emitting a value, the produced stream also completes without emitting an item.

        Returns:
        the current MultiItemCombineIterable
      • using

        @CheckReturnValue
        public <O> Multi<O> using​(java.util.function.Function<java.util.List<?>,​O> combinator)
        Sets the combination logic as parameter and returns a Multi associating the items from the observed stream using this combinator.
        Type Parameters:
        O - the type of item produced by the returned Multi (the return type of the combinator)
        Parameters:
        combinator - the combination function, must not be null
        Returns:
        the new Multi