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

Martin Kouba (JIRA) issues at jboss.org
Wed Jun 20 04:18:00 EDT 2018

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

Martin Kouba commented on CDI-729:

bq. To enable exceptionally and friends...

[~rmannibucau] I still don't get it. What does the {{CompletionStage}} param represent and why is it needed? IMHO an observer should not care about what happened before/after its notification.

Also note that async observers can be notified in parallel.

I can see a lot of misunderstanding in the comments which indicates that this topic is difficult. But otherwise it's a good discussion. Keep going ;-). 

> 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

More information about the cdi-dev mailing list