java.lang.Object
io.smallrye.mutiny.groups.UniOnItemDelay<T>
- Type Parameters:
T- the type of item
Configures the delay applied to the item emission.
It allows delaying the item emitted by the previous
Uni to its downstream.-
Constructor Summary
ConstructorsConstructorDescriptionUniOnItemDelay(Uni<T> upstream, ScheduledExecutorService executor) Creates a newUniOnItemDelayinstance. -
Method Summary
Modifier and TypeMethodDescriptionDelays the item emission by a specific duration.onExecutor(ScheduledExecutorService executor) Configures the executor which is used to wait for the delay duration.
-
Constructor Details
-
UniOnItemDelay
Creates a newUniOnItemDelayinstance.- Parameters:
upstream- the upstream uniexecutor- the executor, can benull, ifnullused the default worker executor.
-
-
Method Details
-
onExecutor
Configures the executor which is used to wait for the delay duration.- Parameters:
executor- the executor, must not benull- Returns:
- this
UniOnItemDelay.
-
by
Delays the item emission by a specific duration.- Parameters:
duration- the duration of the delay, must not benull, must be strictly positive.- Returns:
- the produced
Uni
-
until
Delays the item emission until theUniproduced by the givenFunctionemits an item (potentiallynull)When the upstream emits its item, the passed function is called. The returned Uni is subscribed using the configured executor. Once this Uni emits its item, the item emitted by upstream is propagated downstream. If the Uni fails, the failure is propagated instead.
- Parameters:
function- the function, must not benull- Returns:
- the produced
Uni.
-