T
- the type of itempublic class UniOnItemDelay<T> extends Object
Uni
to its downstream.Constructor and Description |
---|
UniOnItemDelay(Uni<T> upstream,
ScheduledExecutorService executor)
Creates a new
UniOnItemDelay instance. |
Modifier and Type | Method and Description |
---|---|
Uni<T> |
by(Duration duration)
Delays the item emission by a specific duration.
|
UniOnItemDelay<T> |
onExecutor(ScheduledExecutorService executor)
Configures the executor which is used to wait for the delay duration.
|
Uni<T> |
until(Function<? super T,Uni<?>> function)
|
public UniOnItemDelay(Uni<T> upstream, ScheduledExecutorService executor)
UniOnItemDelay
instance.upstream
- the upstream uniexecutor
- the executor, can be null
, if null
used the default worker executor.public UniOnItemDelay<T> onExecutor(ScheduledExecutorService executor)
executor
- the executor, must not be null
UniOnItemDelay
.public Uni<T> by(Duration duration)
duration
- the duration of the delay, must not be null
, must be strictly positive.Uni
public Uni<T> until(Function<? super T,Uni<?>> function)
Uni
produced by the given Function
emits an item
(potentially null
)
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.
function
- the function, must not be null
Uni
.Copyright © 2019–2020 SmallRye. All rights reserved.