Class MultiGroupIntoMultis<T>


  • public class MultiGroupIntoMultis<T>
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Multi<Multi<T>> every​(java.time.Duration duration)
      Creates a Multi that emits Multi of items collected from the observed Multi.
      Multi<Multi<T>> of​(int size)
      Creates a Multi that emits windows of items collected from the observed Multi.
      Multi<Multi<T>> of​(int size, int skip)
      Creates a Multi that emits windows of items collected from the observed Multi.
      • Methods inherited from class java.lang.Object

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

      • MultiGroupIntoMultis

        public MultiGroupIntoMultis​(Multi<T> upstream)
    • Method Detail

      • every

        @CheckReturnValue
        public Multi<Multi<T>> every​(java.time.Duration duration)
        Creates a Multi that emits Multi of items collected from the observed Multi.

        The resulting Multi emits connected, non-overlapping stream of items, each of a fixed duration specified by the duration parameter. If, during the configured time window, no items are emitted by the upstream Multi, an empty Multi is emitted by the returned Multi.

        When the upstream Multi sends the completion event, the resulting Multi emits the current Multi and propagates the completion event.

        If the upstream Multi sends a failure, the failure is propagated immediately.

        Parameters:
        duration - the period of time each Multi collects items before it is emitted and replaced with a new Multi. Must be non null and positive.
        Returns:
        a Multi that emits every duration with the items emitted by the upstream multi during the time window.
      • of

        @CheckReturnValue
        public Multi<Multi<T>> of​(int size)
        Creates a Multi that emits windows of items collected from the observed Multi.

        The resulting Multi emits multis of size consecutive and non-overlapping items. Each emitted Multi is completed once the last item is emitted.

        When the upstream Multi sends the completion event, the Multi emits the current Multi (and the completion event) and sends the completion event. This last Multi may not contain size items. If the upstream Multi sends the completion event before having emitted any event, the completion event is propagated immediately.

        If the upstream Multi sends a failure, the failure is propagated immediately.

        Parameters:
        size - the max number of item in each emitted Multi, must be positive
        Returns:
        a Multi emitting multis of at most size items from the upstream Multi.
      • of

        @CheckReturnValue
        public Multi<Multi<T>> of​(int size,
                                  int skip)
        Creates a Multi that emits windows of items collected from the observed Multi.

        The resulting Multi emits multis every skip items, each containing size items. Each emitted Multi is completed once the last item is emitted.

        When the upstream Multi sends the completion event, the Multi emits the current Multi (and the completion event) and sends the completion event. This last Multi may not contain size items. If the upstream Multi sends the completion event before having emitted any event, the completion event is propagated immediately.

        If the upstream Multi sends a failure, the failure is propagated immediately.

        Parameters:
        size - the max number of item in each emitted Multi, must be positive
        skip - the number of items skipped before starting a new multi. If skip and size are equal, this operation is similar to of(int). Must be positive and non-0
        Returns:
        a Multi emitting multis of at most size items from the upstream Multi.