+
+ }
+
+ return getResult();
+
+ }
+
+ public static <T> T computeForEach(ReadGraphImpl callerGraph, AsyncRead<T> request, AsyncReadEntry<T> entry,
+ AsyncProcedure<T> procedure_, boolean needsToBlock) throws DatabaseException {
+
+ BlockingAsyncProcedure<T> proc = new BlockingAsyncProcedure(callerGraph, entry, procedure_, request, needsToBlock);
+ if(needsToBlock) {
+ return proc.performSync(request);
+ } else {
+ proc.performAsync(request);
+ return null;
+ }
+
+ }
+
+ @Override
+ public String toString() {
+ if (isDiscarded())
+ return "DISCARDED " + id.toString();
+ else if (isExcepted())
+ return id.toString() + " " + getResult();
+ else
+ return id.toString() + " " + statusOrException;
+ }
+
+ @Override
+ public void execute(AsyncReadGraph graph, T result) {
+ Collection<SessionTask> tasks = null;
+ synchronized(this) {
+ setResult(result);
+ setReady();
+ if(pendingTaskSupport != null)
+ tasks = pendingTaskSupport.executePending();