ability to configure async actions update fast-track timeout

GitOrigin-RevId: d1c9520396db3619acc1b506cfaea9b212c4c859
This commit is contained in:
Gregory.Shrago
2021-04-06 18:02:55 +00:00
committed by intellij-monorepo-bot
parent 05af40a707
commit 93d201ee01
2 changed files with 7 additions and 2 deletions
@@ -187,6 +187,8 @@ public final class Utils {
@NotNull ActionGroup group,
boolean hideDisabled,
@Nullable Consumer<String> missedKeys) {
int maxTime = Registry.intValue("actionSystem.update.actions.async.fast.timeout.ms", 20);
if (maxTime < 1) return null;
BlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
ActionUpdater fastUpdater = ActionUpdater.getActionUpdater(updater.asFastUpdateSession(missedKeys, queue::offer));
try (AccessToken ignore = SlowOperations.allowSlowOperations(SlowOperations.FAST_TRACK)) {
@@ -197,7 +199,7 @@ public final class Utils {
Runnable runnable = queue.poll(1, TimeUnit.MILLISECONDS);
if (runnable != null) runnable.run();
long elapsed = System.currentTimeMillis() - start;
if (elapsed > 10) {
if (elapsed > maxTime) {
promise.cancel();
}
});
@@ -37,6 +37,9 @@ actionSystem.update.actions.async=true
actionSystem.update.actions.async.description=Whether to "update" actions on background thread where possible
actionSystem.update.actions.async.ui=true
actionSystem.update.actions.async.ui.description=Whether to pump EDT events during actions "update"
actionSystem.update.actions.async.fast.timeout.ms=20
actionSystem.update.actions.async.fast.timeout.ms.description=A timeout in milliseconds for EDT to wait for actions to update using the fast-track. \
On the fast-track actions are still updated in background but without any slow processing.
actionSystem.update.actions.async.test.delay=0
actionSystem.update.actions.async.test.delay.description=An artificial delay in milliseconds to simulate slow actions in menus, popups, and toolbars
actionSystem.update.touchbar.actions.use.cached=false
@@ -48,7 +51,7 @@ actionSystem.win.suppressAlt.new=true
actionSystem.win.suppressAlt.new.description=Enables another approach to consume Alt which may move focus to main menu (Windows L&F only).
actionSystem.update.timeout.ms=10000
actionSystem.update.timeout.ms.description=Timeout in milliseconds for spending on waiting for actions' "update" on UI thread
actionSystem.update.timeout.ms.description=Timeout in milliseconds for spending on waiting for actions' "update" on UI thread
actionSystem.toolbar.show.group.in.popup=true
actionSystem.toolbar.show.group.in.popup.description=When set to TRUE action groups are shown in popups. When set to FALSE action popup menu is used to show groups