Consuming Arrays from CompletableFutures with Uni / Multi #800
-
Hello, I have gone through the examples a few times and am still a little shaky on the concepts. With this library, What I think I want is to return a Using After reading the concepts again, I believe I do in fact want a Can someone help expand on the concepts for me in the context to consuming a Future of a List? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If I understood correctly, you have something like: CompletableFuture<List<Bucket>> retrieveBucketsUsingS3AsyncApi(); To obtain a Uni<List<Bucket>> uni = Uni.createFrom().completionStage(() -> retrieveBucketsUsingS3AsyncApi()); If you need a Multi<Bucket>> uni = Multi.createFrom().uni(() -> Uni.createFrom().completionStage(() -> retrieveBucketsUsingS3AsyncApi()))
.map(list -> Multi.createFrom().items(list)); |
Beta Was this translation helpful? Give feedback.
If I understood correctly, you have something like:
To obtain a
Uni<List<Bucket>>
, just use:If you need a
Multi<Bucket>
, use: