Class MultiGroupIntoMultis<T>
- java.lang.Object
-
- io.smallrye.mutiny.groups.MultiGroupIntoMultis<T>
-
public class MultiGroupIntoMultis<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MultiGroupIntoMultis(Multi<T> upstream)
-
-
-
Method Detail
-
every
@CheckReturnValue public Multi<Multi<T>> every(java.time.Duration duration)
Creates aMulti
that emitsMulti
of items collected from the observedMulti
.The resulting
Multi
emits connected, non-overlapping stream of items, each of a fixed duration specified by theduration
parameter. If, during the configured time window, no items are emitted by the upstreamMulti
, an emptyMulti
is emitted by the returnedMulti
.When the upstream
Multi
sends the completion event, the resultingMulti
emits the currentMulti
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 nonnull
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 aMulti
that emits windows of items collected from the observedMulti
.The resulting
Multi
emitsmultis
ofsize
consecutive and non-overlapping items. Each emittedMulti
is completed once the last item is emitted.When the upstream
Multi
sends the completion event, theMulti
emits the current Multi (and the completion event) and sends the completion event. This lastMulti
may not containsize
items. If the upstreamMulti
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 emittedMulti
, 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 aMulti
that emits windows of items collected from the observedMulti
.The resulting
Multi
emitsmultis
everyskip
items, each containingsize
items. Each emittedMulti
is completed once the last item is emitted.When the upstream
Multi
sends the completion event, theMulti
emits the current Multi (and the completion event) and sends the completion event. This lastMulti
may not containsize
items. If the upstreamMulti
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 emittedMulti
, must be positiveskip
- the number of items skipped before starting a new multi. Ifskip
andsize
are equal, this operation is similar toof(int)
. Must be positive and non-0- Returns:
- a Multi emitting multis of at most
size
items from the upstream Multi.
-
-