run LaterInvocator events in small batches

to decrease the number of Swing events produced
to eliminate "too many events" from LaterInvocator redispatches
to make TransferToEDTQueue not so necessary
This commit is contained in:
peter
2017-04-28 18:03:47 +02:00
parent 3c5d12fa56
commit b184e5d8d9
@@ -394,8 +394,15 @@ public class LaterInvocator {
@Override
public void run() {
FLUSHER_SCHEDULED.set(false);
if (runNextEvent()) {
requestFlush();
long startTime = System.currentTimeMillis();
while (true) {
if (!runNextEvent()) {
return;
}
if (System.currentTimeMillis() - startTime > 5) {
requestFlush();
return;
}
}
}