Class UniAndGroupIterable<T1>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      UniAndGroupIterable<T1> collectFailures()  
      <O,​I>
      Uni<O>
      combinedWith​(java.lang.Class<I> superType, java.util.function.Function<java.util.List<I>,​O> function)
      Combine the items emitted by the unis, and emit the result when all unis have successfully completed.
      <O> Uni<O> combinedWith​(java.util.function.Function<java.util.List<?>,​O> function)
      Combine the items emitted by the unis, and emit the result when all unis have successfully completed.
      Uni<java.lang.Void> discardItems()
      Discards the items emitted by the combined unis, and just emits null when all the unis have successfully completed.
      UniAndGroupIterable<T1> usingConcurrencyOf​(int level)
      Limit the number of concurrent upstream subscriptions.
      • Methods inherited from class java.lang.Object

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

      • UniAndGroupIterable

        public UniAndGroupIterable​(java.lang.Iterable<? extends Uni<?>> iterable)
      • UniAndGroupIterable

        public UniAndGroupIterable​(Uni<? extends T1> source,
                                   java.lang.Iterable<? extends Uni<?>> iterable)
      • UniAndGroupIterable

        public UniAndGroupIterable​(Uni<? extends T1> source,
                                   java.lang.Iterable<? extends Uni<?>> iterable,
                                   boolean collectFailures)
    • Method Detail

      • usingConcurrencyOf

        @CheckReturnValue
        public UniAndGroupIterable<T1> usingConcurrencyOf​(int level)
        Limit the number of concurrent upstream subscriptions.

        When not specified all upstream Uni are being subscribed when the combining Uni is subscribed.

        Setting a limit is useful when you have a large number of Uni to combine and their simultaneous subscriptions might overwhelm resources (e.g., database connections, etc).

        Parameters:
        level - the concurrency level, must be strictly positive
        Returns:
        an object to configure the combination logic
      • combinedWith

        @CheckReturnValue
        public <O> Uni<O> combinedWith​(java.util.function.Function<java.util.List<?>,​O> function)
        Combine the items emitted by the unis, and emit the result when all unis have successfully completed. In case of failure, the failure is propagated.
        Type Parameters:
        O - the combination value type
        Parameters:
        function - the combination function
        Returns:
        the new Uni
      • combinedWith

        @Experimental("This is an experimental API")
        @CheckReturnValue
        public <O,​I> Uni<O> combinedWith​(java.lang.Class<I> superType,
                                               java.util.function.Function<java.util.List<I>,​O> function)
        Combine the items emitted by the unis, and emit the result when all unis have successfully completed. In case of failure, the failure is propagated.

        This method is a convenience wrapper for combinedWith(Function) but with the assumption that all items have I as a super type, which saves you a cast in the combination function. If the cast fails then the returned Uni fails with a ClassCastException.

        Type Parameters:
        O - the combination value type
        I - the super type of all items
        Parameters:
        superType - the super type of all items
        function - the combination function
        Returns:
        the new Uni
      • discardItems

        @CheckReturnValue
        public Uni<java.lang.Void> discardItems()
        Discards the items emitted by the combined unis, and just emits null when all the unis have successfully completed. In case of failure, the failure is propagated.
        Returns:
        the Uni Uni<Void> emitting null when all the unis have completed, or propagating the failure.