- public static <T> void computeForEach(ReadGraphImpl parentGraph, AsyncRead<T> request, AsyncReadEntry<T> entry,
- AsyncProcedure<T> procedure_) throws DatabaseException {
-
- AsyncProcedure<T> procedure = entry != null ? entry : procedure_;
-
- ReadGraphImpl queryGraph = parentGraph.withParent(entry);
-
- BlockingAsyncProcedure<T> proc = new BlockingAsyncProcedure<>(queryGraph, new AsyncProcedure<T>() {
-
- @Override
- public void execute(AsyncReadGraph returnGraph, T result) {
- try {
- procedure.execute(parentGraph, result);
- } catch (Throwable t) {
- LOGGER.error("computeForEach procedure.execute failed", t);
- }
- }
-
- @Override
- public void exception(AsyncReadGraph returnGraph, Throwable t) {
- try {
- procedure.exception(parentGraph, t);
- } catch (Throwable t2) {
- LOGGER.error("computeForEach procedure.exception failed", t2);
- }
- }
-
- @Override
- public String toString() {
- return procedure.toString();
- }
-
- }, request);
+ public static <T> T computeForEach(ReadGraphImpl callerGraph, AsyncRead<T> request, AsyncReadEntry<T> entry,
+ AsyncProcedure<T> procedure_, boolean needsToBlock) throws DatabaseException {