- Type Parameters:
T- the type of item
Uni. If the Uni receives a failure, the failure is thrown.
This class lets you configure how to retrieves the item of a Uni by blocking the caller thread.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSubscribes to theUniand waits (blocking the caller thread) at most the given duration until an item or failure is fired by the upstream uni.Subscribes to theUniand waits (blocking the caller thread) indefinitely until aitemevent is fired or afailureevent is fired by the upstream uni.
-
Constructor Details
-
UniAwait
-
-
Method Details
-
indefinitely
Subscribes to theUniand waits (blocking the caller thread) indefinitely until aitemevent is fired or afailureevent is fired by the upstream uni.If the
Unifires an item, it returns that item, potentiallynullif the operation returnsnull. If theUnifires a failure, the original exception is thrown (wrapped in aCompletionExceptionit's a checked exception).Note that each call to this method triggers a new subscription.
- Returns:
- the item from the
Uni, potentiallynull
-
atMost
Subscribes to theUniand waits (blocking the caller thread) at most the given duration until an item or failure is fired by the upstream uni.If the
Unifires an item, it returns that item, potentiallynullif the operation returnsnull. If theUnifires a failure, the original exception is thrown (wrapped in aCompletionExceptionit's a checked exception). If the timeout is reached before completion, aTimeoutExceptionis thrown.Note that each call to this method triggers a new subscription.
- Parameters:
duration- the duration, must not benull, must not be negative or zero.- Returns:
- the item from the
Uni, potentiallynull
-
asOptional
Indicates that you are awaiting for the item event of the attachedUniwrapped into anOptional. So if theUnifiresnullas item, you receive an emptyOptional.- Returns:
- the
UniAwaitOptionalconfigured to produce anOptional.
-