Skip to content

Question regarding nesting of calls #693

Answered by Reef3rm4n
Reef3rm4n asked this question in Q&A
Discussion options

You must be logged in to vote

ive' managed to get this to work with the following

Uni.createFrom().item(whatEver) // simulates upstream
.map(
    item ->
        pgPool.select(item.parameters)
        .call(item1 -> performLogic(item1))
        .call(item1 -> pool.withTransaction(client -> client.update(item1.parameters)))
)
.flatMap(item -> item)
.subscribe()
.with(whatEver)

so basically i think i was not flattening the withTransaction that returns a Uni of Uni
but im not convinced of this solution, can anyone weight in ? by the way the withTransaction part is supposed to update various tables using optmistic locking that's why i need to start the operation from the top most map() call

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Reef3rm4n
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant