[cdi-dev] [JBoss JIRA] (CDI-31) Asynchronous events

Jonathan Fisher (JIRA) jira-events at lists.jboss.org
Mon Apr 23 13:01:19 EDT 2012


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

Jonathan Fisher commented on CDI-31:
------------------------------------

@Mark That is an excellent poin, but, it sounds like we're dismissing this prematurely without quantifying your statement.

I believe that the server could use a TaskExecutor internally and establish a thread pool to set limits on the resources consumed by something marked as @ Asynchronous. This is a fairly common pattern, and nothing out of the ordinary. I think the only thing that complicates this is scoped CDI beans.

The first possibility is we say each @Async execution is independent. This would be incredibly easy to implement, and it would be on the developer to pass any state (via the Event). Essentially, each @Async event operates in it's own transaction, request context, etc.

More in the spirit of CDI is to preserve the request context, transaction context, etc when executing an Async request. This is a fairly difficult implementation, but it's been done before with EJB, and perhaps that model could be simplified for CDI.

Lets discuss the complications that I did not take into account...
                
> Asynchronous events
> -------------------
>
>                 Key: CDI-31
>                 URL: https://issues.jboss.org/browse/CDI-31
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Events
>    Affects Versions: 1.0
>            Reporter: Nicklas Karlsson
>             Fix For: TBD
>
>
> Consider including asynchronous events as their were specified in one of the previous drafts.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the cdi-dev mailing list