]
Manik Surtani commented on JGRP-518:
------------------------------------
Timeouts are ugly.
I prefer letting the filter contain logic around returning. So how about if the filter
looks like:
public interface ResponseFilter
{
boolean isAcceptable(Object response);
boolean needMoreResponses();
}
Does that work for you? So every time a response comes in and you use the filter to test
whether the response is acceptable, you also test whether you need to wait for more
responses or you can just break and return the responses received so far.
RpcDispatcher: filter for accepting incoming responses
------------------------------------------------------
Key: JGRP-518
URL:
http://jira.jboss.com/jira/browse/JGRP-518
Project: JGroups
Issue Type: Feature Request
Reporter: Manik Surtani
Assigned To: Bela Ban
Fix For: 2.6
[Manik's email]
Are there any plans to implement a way to register a filter when using the RpcDispatcher
when waiting for results?
Current options (GroupRequest.GET_ALL, GET_NONE, GET_MOST, GET_FIRST, etc) is
insufficient where you want the call to block until the first *acceptable* response is
received.
Basically, if I expect responses from everyone in the cluster but want to wait for the
first acceptable response, I have no choice but to do a GET_ALL and then parse all the
responses for the first acceptable one. Now the definition of an acceptable response is
application-specific, and so perhaps a mechanism to register a filter would be useful.
Perhaps something like:
RpcDispatcher.callRemoteMethods(Vector dests, MethodCall call, int mode, long
timeout, boolean use_anycasting, ResponseFilter responseFilter)
public interface ResponseFilter
{
boolean isAcceptable(Object response);
}
If a filter is provided, only responses that pass the isAcceptable() test is added to the
response list. Then GroupRequest.GET_FIRST could be used and we could have a very
efficient mechanism of not having to wait for all responses.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: