<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div></div></div></div></div></div><div class="gmail_quote">2015-03-19 16:44 GMT+01:00 Antoine Sabot-Durand <span dir="ltr">&lt;<a href="mailto:antoine@sabot-durand.net" target="_blank">antoine@sabot-durand.net</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>Le 19 mars 2015 à 15:51, Romain Manni-Bucau &lt;<a href="mailto:rmannibucau@gmail.com" target="_blank">rmannibucau@gmail.com</a>&gt; a écrit :</div><span class=""><br><div><div dir="ltr">sounds like a quick and dirty solution to me. @Async will arrive</div></div></span></blockquote><div><br></div><div>Yes like in “Async is coming” ;)</div><span class=""><br><blockquote type="cite"><div><div dir="ltr"> - maybe too early today - but adding @ObservesAsync just cause we dont have yet @Async will make this API obselete pretty quickly isn&#39;t it (already cause of EJB actually).</div></div></blockquote><div><br></div></span><div>and if we add an @Async in our spec you think it’s better ?</div><span class=""><br></span></div></div></blockquote><div><br></div><div>no we agree </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Do we really want this feature at this price?</div></div></div></blockquote><div><br></div></span><div>#1 requested feature by users.</div><span class=""><br></span></div></div></blockquote><div><br></div><div>not a reason to mess up the spec IMO. One of the best feature of EE is its stability, here I think we break this basic rule knowing it which doesn&#39;t sound professional from my window.</div><div><br></div><div>This feature is important but already doable today - I guess all vendors provide a solution so business wise you are not blocked and you can even stay portable with very few code (even no code in EE).</div><div><br></div><div>Other point is defining a more appropriated API is surely needed interacting with the @async/threading spec. EE concurrency spec has something which could help in context propagation if spec is updated: <a href="http://docs.oracle.com/javaee/7/api/javax/enterprise/concurrent/ContextService.html">http://docs.oracle.com/javaee/7/api/javax/enterprise/concurrent/ContextService.html</a></div><div><br></div><div>can be a way to get context propagation but manually this way it is a &quot;use it at your own risk&quot; solution which is the best can do.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><blockquote type="cite"><div><div dir="ltr"><div>If yes <b style="font-size:12.8000001907349px">AsyncObserves </b><span style="font-size:12.8000001907349px">sounds an acceptable compromise but still will mess up the API IMO.</span></div></div></div></blockquote><div><br></div></span><div>The question is “Is it more or less messy than @Async @Observes?&quot;  I don’t know… It has pros and cons as I listed... </div><div><div class="h5"><br></div></div></div></div></blockquote><div><br></div><div>agree, both are intermediary states probably which is not satisfying. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div class="h5"><blockquote type="cite"><div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br><span style="font-size:small">Romain Manni-Bucau</span><br><a href="https://twitter.com/rmannibucau" target="_blank">@rmannibucau</a> |  <a href="http://rmannibucau.wordpress.com/" target="_blank">Blog</a> | <a href="https://github.com/rmannibucau" target="_blank">Github</a> | <a href="https://www.linkedin.com/in/rmannibucau" target="_blank">LinkedIn</a> | <a href="http://www.tomitribe.com/" target="_blank">Tomitriber</a></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2015-03-19 15:36 GMT+01:00 Antoine Sabot-Durand <span dir="ltr">&lt;<a href="mailto:antoine@sabot-durand.net" target="_blank">antoine@sabot-durand.net</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hi guys,<div><br></div><div><br></div><div>So it seems impossible to avoid opt-in on the observer side for the sake of awkward compatibility.</div><div>Adding a member to @Observes could also be a source of issues when old CDI lib will be used with CDI 2.0 runtime. Some of us (including me) don’t want to add an @Async annotation to CDI spec, so perhaps we should add an async alternative to @Observes with an @AsyncObserves or @ObservesAsync ?</div><div><br></div><div><div>So it would be</div><div><br></div><div>public void myObserver(<b>@AsyncObserves</b> payload) {}</div><div><br></div><div>instead of</div><div><br></div><div><b>@Async</b></div><div>public void myObserver(@Observes payload) {}</div></div><div><br></div><div><br></div><div>Pros :</div><div>- it’s a cleaner way to manage the opt-in than to put 2 annotations or add a member to an existing one</div><div>- it could have new members related to async behavior (context propagation, concurrent scenario, etc…)</div><div>- As it won’t be in legacy code no risk to see old observers called asynchronously  </div><div><br></div><div>Cons :</div><div>- Still not clear for users when fire() is called to see @AsyncObserves launched synchronously</div><div>- Yet another annotation added</div><div><br></div><div>wdyt ?</div><span><font color="#888888"><div><br></div><div>Antoine</div></font></span></div><br>_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br></blockquote></div><br></div>
</div></blockquote></div></div></div><br></div></blockquote></div><br></div></div>