[cdi-dev] [JBoss JIRA] (CDI-729) Async event not CompletionStage friendly

Romain Manni-Bucau (JIRA) issues at jboss.org
Tue Jun 19 10:50:00 EDT 2018


    [ https://issues.jboss.org/browse/CDI-729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13593943#comment-13593943 ] 

Romain Manni-Bucau commented on CDI-729:
----------------------------------------

Not sure what you mean. From the point you can return a CompletionStage and cdi container append it to the "waited" CompletionStage then you are good and can introduce the error handling you want in all layers (either the nested one for internal error handling and backpressure to the fireAsync caller or directly in the caller layer to get a default error handling. Indeed you can stack a lot of promises but it is what you intend with this pattern and if you care (means you dont trust observers) then you combine it with timeouts.

In terms of implementations it is really <5mn with tests on cdi impl side.

> Async event not CompletionStage friendly
> ----------------------------------------
>
>                 Key: CDI-729
>                 URL: https://issues.jboss.org/browse/CDI-729
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: Romain Manni-Bucau
>
> The goal of this ticket is to enable user to get injected the completion future instead of the raw event and return another completion stage (generic type ignored) to enable the "chain" to be synched.
> Here is a sample:
> 1. fireAsync(persistEvent)
> 2. observer implementation does: return future.thenCompose(db::doAsyncPersist)
> 3. when the user gets back the result of the fireAsync the doAsyncPersist is completed.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the cdi-dev mailing list