final LinkedList<T> items = new LinkedList<T>();
protected ExternalRead<T> id;
- protected ReadGraphImpl graph;
+ protected QueryProcessor processor;
protected boolean registered = false;
@Override
public void discard() {
id.unregistered();
id = null;
- graph = null;
+ processor = null;
super.discard();
}
public ExternalReadEntry(ExternalRead<T> request, ReadGraphImpl graph) {
assert request != null;
this.id = request;
- this.graph = graph;
+ this.processor = graph.processor;
}
@Override
try {
- ReadGraphImpl queryGraph = graph.withParent(this);
+ ReadGraphImpl queryGraph = graph.withParent(this, null, true);
+ queryGraph.asyncBarrier.inc();
- if(!registered) {
- id.register(graph, this);
+ if (!registered) {
+ id.register(queryGraph, this);
registered = true;
}
-
- queryGraph.asyncBarrier.waitBarrier(id, graph);
+
+ queryGraph.asyncBarrier.dec();
+ queryGraph.asyncBarrier.waitBarrier(id, queryGraph);
} catch (Throwable t) {
synchronized(items) {
items.addLast(result);
- graph.processor.updatePrimitive(id);
+ processor.updatePrimitive(id);
// TODO: implement flags/logic in ExternalRead to state that all but the latest request result can be evaporated
// In some cases where data is produced really fast this might be necessary but currently this queueing will do.
}
@Override
public boolean isDisposed() {
- return registered && (isDiscarded() || !graph.processor.isBound(this));
+ return registered && (isDiscarded() || !processor.isBound(this));
}
}