<div dir="ltr">I like the idea of having a variable to set on the listener annotation.  This way we can know for sure if we need to force previous values for some listeners and not for others.<div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">It seems the default should be to force the previous value to be more inline with the current behavior, but I fear no one will use the opposite in this case though.  What do you guys think?</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 22, 2016 at 4:31 AM Adrian Nistor &lt;<a href="mailto:anistor@redhat.com">anistor@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Radim,<br>
<br>
Continuous query is built on top of these listeners. CQ _always_ needs<br>
the previous value and it is very convenient in this case that the<br>
command is forced to load the previous value. I imagine there may be<br>
other use cases where we cannot live without the prev value.<br>
<br>
I think the listener should be able to state if it needs the prev value<br>
at registration time. Maybe add a new attribute in the Listener<br>
annotation? Similar to how we handled Observation.<br>
<br>
Adrian<br>
<br>
On 08/19/2016 11:34 PM, Radim Vansa wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; as I am trying to simplify current entry wrapping and distribution code,<br>
&gt; I often find that listeners can get wrong previous value in the event,<br>
&gt; and it sometimes forces the command to load the value even if it is not<br>
&gt; needed for the command.<br>
&gt;<br>
&gt; I am wondering if we should change the previous value in events to<br>
&gt; Optional - we can usually at least detect that we cannot provide a<br>
&gt; reliable value (e.g. after retry due to topology change, or because the<br>
&gt; command did not bothered to load the previous value from cache loader)<br>
&gt; and return empty Optional.<br>
&gt;<br>
&gt; WDYT?<br>
&gt;<br>
&gt; Radim<br>
&gt;<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div>