@Override
public void recompute(ReadGraphImpl graph) {
- request.perform(graph , new AsyncMultiProcedure<T>() {
+ try {
- @Override
- public void execute(AsyncReadGraph graph, T result) {
- addOrSet(result);
- }
+ GraphSemaphore s = new GraphSemaphore(graph, 0);
- public void finished(AsyncReadGraph graph) {
- finish(graph);
- };
+ request.perform(graph , new AsyncMultiProcedure<T>() {
- @Override
- public void exception(AsyncReadGraph graph, Throwable t) {
- except(t);
- }
+ @Override
+ public void execute(AsyncReadGraph graph, T result) {
+ addOrSet(result);
+ }
- });
+ public void finished(AsyncReadGraph graph) {
+ finish(graph);
+ s.release();
+ };
+
+ @Override
+ public void exception(AsyncReadGraph graph, Throwable t) {
+ except(t);
+ s.release();
+ }
+
+ });
+
+ s.waitFor(1);
+
+ } catch (Throwable t) {
+
+ except(t);
+
+ }
}
else return request.toString() + statusOrException;
}
- @Override
+ //@Override
public Object compute(ReadGraphImpl graph, AsyncMultiProcedure<T> procedure) throws DatabaseException {
return graph.processor.cache.performQuery(graph, request, this, procedure);
}