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

James Roper (JIRA) issues at jboss.org
Tue Jun 19 13:17:00 EDT 2018

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

James Roper commented on CDI-729:

Ah, sorry I misunderstood.

Why is a {{CompletionStage}} of the event needed to be passed to the method? To use it, the first thing that will need to be done is to attach a {{thenCompose}} to the completion stage. Why not have CDI do a {{thenCompose}} first, and then just invoke the method directly with the actual event? I don't see what value is gained by passing in a {{CompletionStage}}, an event when published is always available immediately, {{CompletionStage}} is for values that aren't available yet.

> 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