use of org.apache.ignite.internal.util.typedef.internal.GPR in project ignite by apache.
the class GridEventStorageManager method remoteEventsAsync.
/**
* @param p Grid event predicate.
* @param nodes Collection of nodes.
* @param timeout Maximum time to wait for result, if {@code 0}, then wait until result is received.
* @return Collection of events.
*/
public <T extends Event> IgniteInternalFuture<List<T>> remoteEventsAsync(final IgnitePredicate<T> p, final Collection<? extends ClusterNode> nodes, final long timeout) {
assert p != null;
assert nodes != null;
final GridFutureAdapter<List<T>> fut = new GridFutureAdapter<>();
ctx.closure().runLocalSafe(new GPR() {
@Override
public void run() {
try {
fut.onDone(query(p, nodes, timeout));
} catch (IgniteCheckedException e) {
fut.onDone(e);
}
}
}, true);
return fut;
}
Aggregations