use of com.hazelcast.client.executor.tasks.NullCallable in project hazelcast by hazelcast.
the class ClientExecutorServiceSubmitTest method submitCallableWithNullResultToAllMembers_withMultiExecutionCallback.
@Test
public void submitCallableWithNullResultToAllMembers_withMultiExecutionCallback() throws Exception {
IExecutorService service = client.getExecutorService(randomString());
final CountDownLatch responseLatch = new CountDownLatch(CLUSTER_SIZE);
final CountDownLatch completeLatch = new CountDownLatch(CLUSTER_SIZE);
Callable callable = new NullCallable();
service.submitToAllMembers(callable, new MultiExecutionCallback() {
public void onResponse(Member member, Object value) {
if (value == null) {
responseLatch.countDown();
}
}
public void onComplete(Map<Member, Object> values) {
for (Member member : values.keySet()) {
Object value = values.get(member);
if (value == null) {
completeLatch.countDown();
}
}
}
});
assertOpenEventually("responseLatch", responseLatch);
assertOpenEventually("completeLatch", completeLatch);
}
Aggregations