<div dir="ltr">I like the idea of returning the event payload but it would be inconsistent with the existing fire(U event) method. Am I right, that changing the old fire method in the same way is not an option?<div><br></div><div>Regards,</div><div>Thorben</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>--</div><div><b>Thorben Janssen</b><br></div><div><br></div><div><a href="https://twitter.com/thjanssen123" target="_blank">@thjanssen123</a><br></div><a href="http://www.thoughts-on-java.org" target="_blank">www.thoughts-on-java.org</a> <br></div></div></div>
<br><div class="gmail_quote">2015-06-05 19:43 GMT+02: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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes Jozef,<br><br><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">As said multiple times we cannot prevent users to mute payload in async events but they should know that it&#39;s their responsibility to do so (no concurrency or thread safety guaranteed by us).</span><br></div><div>I have no problem to revert this. My idea was to be consistent with synchronous observer returning void.</div><div>I also feared that returning an handle on the payload could confuse users, making them think that we manage concurrency and thread safety on the payload when we don&#39;t do it.</div><div>Now, adding the payload to the async pipeline coule make sense...</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Antoine</div></font></span><span class=""><div><br></div><br><div class="gmail_quote"><div dir="ltr">Le ven. 5 juin 2015 à 08:49, Jozef Hartinger &lt;<a href="mailto:jharting@redhat.com" target="_blank">jharting@redhat.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 06/04/2015 10:08 AM, Antoine Sabot-Durand wrote:<br>
&gt; In our initial proposal fireAsync basic signature was<br>
&gt;<br>
&gt; &lt;U extends T&gt; CompletionStage&lt;U&gt; fireAsync(U event);<br>
&gt;<br>
&gt; I simplified the signature with<br>
&gt;<br>
&gt; CompletionStage&lt;void&gt; fireAsync (U event);<br>
&gt;<br>
&gt; As the original fire method returns void I found confusing to return<br>
&gt; anything something letting think that a value (different than a<br>
&gt; status) was obtained from the observers notification.<br>
<br>
The reason for the original signature was that it allows the event<br>
payload to be processed further once all the observers finish. This is<br>
useful in the common pattern where you fire a mutable event, let the<br>
(possibly unknown) observers contribute to the result by mutating the<br>
payload, and then work with the payload when all finish. See e.g.<br>
<a href="https://github.com/weld/core/blob/master/tests-arquillian/src/test/java/org/jboss/weld/tests/experimental/event/async/complex/ComplexAsyncEventTest.java#L74" target="_blank">https://github.com/weld/core/blob/master/tests-arquillian/src/test/java/org/jboss/weld/tests/experimental/event/async/complex/ComplexAsyncEventTest.java#L74</a><br>
<br>
This of course assumes mutable event payloads are supported.<br>
</blockquote></div></span></div>
<br>_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">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>