Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1899#discussion_r170691220 --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ArtemisExecutor.java --- @@ -50,6 +50,16 @@ default int shutdownNow(Consumer<? super Runnable> onPendingTask) { return 0; } + default boolean flush(long timeout, TimeUnit unit) { + CountDownLatch latch = new CountDownLatch(1); + execute(latch::countDown); --- End diff -- if the latch is submitted from within the same thread that is executing the tasks, waiting won't be necessary, because it cannot be triggered
---