[jboss-jira] [JBoss JIRA] (JGRP-2094) Add convenience method Rsp.readIn
Radim Vansa (JIRA)
issues at jboss.org
Tue Aug 2 10:02:00 EDT 2016
[ https://issues.jboss.org/browse/JGRP-2094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Radim Vansa reassigned JGRP-2094:
---------------------------------
Assignee: Radim Vansa (was: Bela Ban)
> Add convenience method Rsp.readIn
> ---------------------------------
>
> Key: JGRP-2094
> URL: https://issues.jboss.org/browse/JGRP-2094
> Project: JGroups
> Issue Type: Enhancement
> Affects Versions: 3.6.10
> Reporter: Radim Vansa
> Assignee: Radim Vansa
> Priority: Minor
>
> In Infinispan, during a staggered get we prepare several {{Rsp}}s in {{RspList}} and then for each {{Rsp}} we send one message. As the {{RspList}} can be accessed by multiple threads but we don't want to synchronize the access, we just get the {{Rsp}} and fill it from the (other) received {{Rsp}}. However the fill requires several ifs:
> {code}
> if (rsp.hasException()) {
> futureRsp.setException(rsp.getException());
> } else if (rsp.wasSuspected()) {
> futureRsp.setSuspected();
> } else if (rsp.wasUnreachable()) {
> futureRsp.setUnreachable();
> } else {
> futureRsp.setValue(rsp.getValue());
> }
> {code}
> Let's add a convenience method that will just read in the flags and value.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list