void (@NotNull String pattern, @NotNull ProgressIndicator progressIndicator, @NotNull Processor<? super Object> consumer) { try { Thread.sleep(initDelay); for (Object item : items) { ApplicationManager.getApplication().invokeAndWait(() -> WriteAction.run(() -> {})); consumer.process(item); Thread.sleep(eachItemDelay); } } catch (InterruptedException ignored) { } }