<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>One of the SE folks just pointed me to this:&nbsp;<a href="http://cs.oswego.edu/pipermail/concurrency-interest/2015-January/013600.html">http://cs.oswego.edu/pipermail/concurrency-interest/2015-January/013600.html</a>. They are already working on allowing subclasses that change the default executor. If I get more feedback from them I will pass it on here.</div><div><br>On Mar 8, 2016, at 7:19 AM, Reza Rahman &lt;<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>FYI I am running a survey on this issue:&nbsp;<a href="https://twitter.com/reza_rahman/status/707035213717774336">https://twitter.com/reza_rahman/status/707035213717774336</a>. If you really are open to feedback, I suggest keeping an eye there. When it is done, it is possible I will blog about this if it is clear this is a going to be a problem. In the least people will hopefully have that as a resource when they are confused.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">The reality is that everyone has limited time. I can provide feedback when I can provide feedback for any number of personal reasons including whether my employer allows it. It is ultimately up to you to consider it fairly and objectively at all times. If you are failing to do that for any reason before the spec is final it is rather unfortunate for anyone relying on the spec.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">In the end the beauty of all of this is that none of this impacts my livelihood immediately any more. I am just another developer again now. In the end I get to walk over to the Spring camp like everyone else. And thank goodness for that freedom.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Kindly do not assume I will be spending a lot of time providing you feedback going forward. That was unlikely at all times given my time constraints. You should assume the same for most developers out there. When you get feedback from us, you should consider it in that light.</div><div><br>On Mar 8, 2016, at 5:37 AM, Antoine Sabot-Durand &lt;<a href="mailto:antoine@sabot-durand.net">antoine@sabot-durand.net</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Answer inline<br><br><div class="gmail_quote"><div dir="ltr">Le&nbsp;mar. 8 mars 2016 à&nbsp;03:15, Reza Rahman &lt;<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a>&gt; a écrit&nbsp;:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>I have forwarded this issue to the Java EE platform EG for review. My inclination now is to simply leave this alone with a final earnest request to kindly think carefully about this before finalizing and getting this into the real world. Please keep in mind that the average developer is not that skilled and looks to resources on the web routinely for answers. All those resources are going to immediately point to CompletableFuture, not some obscure superclass.</div></div></blockquote><div><br></div><div>CS is not an obscure superclass it's an interface and all methods in CF returns it, so it's impossible &nbsp;to learn CF and ignore CS existence.</div><div>Concurrency is not an easy feature to use, people that think they can cut and paste code from stack overflow without digging in the doc will hit a wall very soon.</div><div>We decided to return a CS to allow advanced user to use it to build async pipeline from here. I guess that the majority of beginners will ignore this returned object (as they would have do it if it had been a CF).</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br></div><div>All I am trying to do is help design an API that is not going to immediately become difficult for the average end developer to understand and use. It's rather unfortunate that I am already feeling fed up in that simple effort to provide feedback.</div></div></blockquote><div><br></div><div>Reza, feedback is always welcome. But if you don't do it in time you should expect some resistance from the EG who worked a long time (and in an open way) to take these decision. So you need more arguments than "user don't know CS" to make us switch from an interface to an impl, that is not suited for Java EE.</div><div>Feedback on possible technical issues are welcome. &nbsp;</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br></div><div>Anyway I am now basically done with this. Unfortunately I have far more urgent matters for Java EE 7 and Java EE 8 to deal with. If I have time I'll look at some more of the CDI 2 work and provide feedback if I can manage time.</div></div></blockquote><div><br></div><div>Again it's welcome. We are about to discuss a programmatic APi for SE boot. Your input will be precious here.</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br>On Mar 7, 2016, at 2:53 PM, Reza Rahman &lt;<a href="mailto:reza_rahman@lycos.com" target="_blank">reza_rahman@lycos.com</a>&gt; wrote:<br>Argue</div><blockquote type="cite"><div><div>Yes, this can be done with a CompletableFuture that has already been constructed - just take a look at the API.</div><div><br></div><div>As far as not adding it to CDI, I can see either way. What was the original motivation for adding CompletableFutures?</div><div><br></div><div>Also, it's a good idea to run this by the platform expert group. I know at least JAX-RS is planning to use CompletableFutures for their client API.</div><div><br>On Mar 7, 2016, at 2:39 PM, Romain Manni-Bucau &lt;<a href="mailto:rmannibucau@gmail.com" target="_blank">rmannibucau@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div></div></div></div></div></div><div class="gmail_quote">2016-03-07 20:35 GMT+01:00 Reza Rahman <span dir="ltr">&lt;<a href="mailto:reza_rahman@lycos.com" target="_blank">reza_rahman@lycos.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Talking with a colleague about this he reminded me of an important fact I almost forgot. The CompletableFuture API can actually be used with custom executors. That means users concerned about managed threads in a Java EE environment can use it with existing EE 7 concurrency executors.</div><div><br></div><div>Basically this means CompletableFutures are already pretty Java EE ready.</div><div><br></div><div>If this is the main cited reason for using CompletionStage, is it really that valid of an argument to justify yet another custom subclass specific only to CDI instead of what's likely to be far more familiar and expected?</div><div><div><div><br></div></div></div></div></blockquote><div><br></div><div>Did he mention it is true for *created* comlpetion future which is not the case for async events? But this is a good point to not add anything to CDI: the feature is a one liner *already*.</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div><div>On Mar 7, 2016, at 8:11 AM, Reza Rahman &lt;<a href="mailto:reza_rahman@lycos.com" target="_blank">reza_rahman@lycos.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div>I think this is a very bad idea. It's better not to use either API and wait to sort out how CompletableFuture can be used in EE consistently. Because of backwards compatibility rules, it is better to have no API than a bad API.</div><div><br>On Mar 7, 2016, at 3:45 AM, Romain Manni-Bucau &lt;<a href="mailto:rmannibucau@gmail.com" target="_blank">rmannibucau@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-03-07 9:07 GMT+01:00 Martin Kouba <span dir="ltr">&lt;<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Dne 7.3.2016 v 09:03 Romain Manni-Bucau napsal(a):<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
<br>
Le 7 mars 2016 08:35, "Martin Kouba" &lt;<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a><br></span>
&lt;mailto:<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>&gt;&gt; a écrit :<span><br>
&nbsp;&gt;<br>
&nbsp;&gt; Dne 6.3.2016 v 15:39 Romain Manni-Bucau napsal(a):<br>
&nbsp;&gt;<br>
&nbsp;&gt;&gt; Hi guys,<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt; as a user having a ComlpetionStage makes me loose some JDK utilities,<br>
&nbsp;&gt;&gt; can we move back to CompletionFuture?<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt; It would allow for instance:<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt; // doesn't work with CompletionStage<br>
&nbsp;&gt;&gt; CompletionFuture.allOf(event1.fireAsync(...), event2.fireAsync(...))<br>
&nbsp;&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; .then(...)<br>
&nbsp;&gt;<br>
&nbsp;&gt;<br>
&nbsp;&gt; Well, this should work if the underlying CompletionStage impl<br>
supports toCompletableFuture(), i.e. in Weld 3:<br>
&nbsp;&gt;<br>
<br>
Yes but it is not natural to convert it IMO = we can do better<br>
<br>
&nbsp;&gt; CompletableFuture.allOf(event1.fireAsync(...).toCompletableFuture(),<br>
event2.fireAsync(...).toCompletableFuture())<br>
&nbsp;&gt;<br>
&nbsp;&gt; AFAIK the default async execution facility of CompletableFuture is<br>
ForkJoinPool.commonPool() which is not a good fit for Java EE. Using the<br>
CompletionStage interface allows us to wrap the async calls without the<br>
specified executor (e.g. CompletionStage.thenApplyAsync(Function&lt;? super<br>
T, ? extends U&gt;)) and supply a default one provided by the impl.<br>
&nbsp;&gt;<br>
<br>
Should use the pool in which the evznt is fired then "then step" is<br>
synchronous is my sample so all is decided at fire time<br>
</span></blockquote>
<br>
I don't talk about your particular example - I understand that it's not using async exec (although the "then()" method does not exist).<br>
<br></blockquote><div><br></div><div>was supposed to represent the different flavours (thenRun, thenCompose, ...) ;).</div><div><br></div><div>That said I agree on the state switching the pool is better but with these 2 notes:</div><div><br></div><div>- could be better to hide these poorly designed methods then -&gt; don't use CompletionXXX but a CDI API with a bridge to CompletionX to let the user go back on SE tools</div><div>- we still don't have a *standard* config for the pool(s) underlying CDI features so it sounds as poor as SE solution IMO (at least a core/max/ttl config in beans.xml)</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
<br>
&nbsp;&gt;<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt; Romain Manni-Bucau<br>
&nbsp;&gt;&gt; @rmannibucau &lt;<a href="https://twitter.com/rmannibucau" rel="noreferrer" target="_blank">https://twitter.com/rmannibucau</a>&gt; | Blog<br>
&nbsp;&gt;&gt; &lt;<a href="http://rmannibucau.wordpress.com" rel="noreferrer" target="_blank">http://rmannibucau.wordpress.com</a>&gt; | Github<br>
&nbsp;&gt;&gt; &lt;<a href="https://github.com/rmannibucau" rel="noreferrer" target="_blank">https://github.com/rmannibucau</a>&gt; | LinkedIn<br>
&nbsp;&gt;&gt; &lt;<a href="https://www.linkedin.com/in/rmannibucau" rel="noreferrer" target="_blank">https://www.linkedin.com/in/rmannibucau</a>&gt; | Tomitriber<br>
&nbsp;&gt;&gt; &lt;<a href="http://www.tomitribe.com" rel="noreferrer" target="_blank">http://www.tomitribe.com</a>&gt;<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt; _______________________________________________<br>
&nbsp;&gt;&gt; cdi-dev mailing list<br></span>
&nbsp;&gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a>&gt;<span><br>
&nbsp;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;&gt; Note that for all code provided on this list, the provider licenses<br>
the code under the Apache License, Version 2<br>
(<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas<br>
provided on this list, the provider waives all patent and other<br>
intellectual property rights inherent in such information.<br>
&nbsp;&gt;&gt;<br>
&nbsp;&gt;<br>
&nbsp;&gt; --<br>
&nbsp;&gt; Martin Kouba<br>
&nbsp;&gt; Software Engineer<br>
&nbsp;&gt; Red Hat, Czech Republic<br>
<br>
</span></blockquote><div><div>
<br>
-- <br>
Martin Kouba<br>
Software Engineer<br>
Red Hat, Czech Republic<br>
</div></div></blockquote></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>cdi-dev mailing list</span><br><span><a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></span><br><span></span><br><span>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.</span></div></blockquote></div></blockquote></div></div></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" rel="noreferrer" 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" rel="noreferrer" 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>
</div></blockquote></div></blockquote></div>_______________________________________________<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" rel="noreferrer" 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" rel="noreferrer" 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.</blockquote></div></div>
</div></blockquote></div></blockquote></body></html>