Some more commenting for AsyncEventLoop
This commit is contained in:
@@ -27,11 +27,14 @@ public class AsyncEventLoop extends AdvancedEventLoop {
|
||||
// Submit all defined preprocessing methods as async tasks
|
||||
for (int i = 0; i < handlerList.size(); i++) {
|
||||
if (handlerList.get(i).getPreprocessMethod() == null) {
|
||||
// We have already "allocated" a space for this task in CountDownLatch,
|
||||
// but since there is no actual preprocess method defined for this handler
|
||||
// we just skip it by ticking the latch down manually
|
||||
latch.countDown();
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
preEventExecutor.submit(new PreprocessTask(i, eventBatch, latch, handlerList.get(i), event));
|
||||
}
|
||||
}
|
||||
|
||||
// Await for them to complete
|
||||
try {
|
||||
@@ -44,9 +47,7 @@ public class AsyncEventLoop extends AdvancedEventLoop {
|
||||
// data obtained from EventBatch
|
||||
for (int i = 0; i < handlerList.size(); i++) {
|
||||
ExecutorLink link = handlerList.get(i);
|
||||
if (link.isIgnoreCancelled() && event.isCanceled())
|
||||
continue;
|
||||
|
||||
if (!link.isIgnoreCancelled() || !event.isCanceled()) {
|
||||
try {
|
||||
if (link.getResultInjection() != null)
|
||||
link.getMethod().invoke(link.getObject(), event, eventBatch.getInjectionObject(i));
|
||||
@@ -59,4 +60,5 @@ public class AsyncEventLoop extends AdvancedEventLoop {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user