@@ -0,0 +1,1791 @@
+package io.undertow.util;%0A%0Aimport io.undertow.UndertowLogger;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0Aimport java.util.concurrent.Executor;%0A%0A/**%0A * Executor that will continue to re-run tasks in a loop that are submitted from its own thread.%0A *%0A * @author Stuart Douglas%0A */%0Apublic class ContinuingExecutor implements Executor %7B%0A%0A    private final Executor executor;%0A%0A    private static final ThreadLocal%3CLinkedList%3CRunnable%3E%3E THREAD_QUEUE = new ThreadLocal%3CLinkedList%3CRunnable%3E%3E();%0A%0A    public ContinuingExecutor(Executor executor) %7B%0A        this.executor = executor;%0A    %7D%0A%0A    @Override%0A    public void execute(final Runnable command) %7B%0A        List%3CRunnable%3E queue = THREAD_QUEUE.get();%0A        if (queue != null) %7B%0A            queue.add(command);%0A        %7D else %7B%0A            executor.execute(new Runnable() %7B%0A                @Override%0A                public void run() %7B%0A                    LinkedList%3CRunnable%3E queue = THREAD_QUEUE.get();%0A                    if (queue == null) %7B%0A                        THREAD_QUEUE.set(queue = new LinkedList%3CRunnable%3E());%0A                    %7D%0A                    try %7B%0A                        command.run();%0A                    %7D catch (Throwable t) %7B%0A                        UndertowLogger.REQUEST_LOGGER.debugf(t, %22Task %25s failed%22, command);%0A                    %7D%0A                    Runnable runnable = queue.poll();%0A                    while (runnable != null) %7B%0A                        try %7B%0A                            command.run();%0A                        %7D catch (Throwable t) %7B%0A                            UndertowLogger.REQUEST_LOGGER.debugf(t, %22Task %25s failed%22, command);%0A                        %7D%0A                        runnable = queue.poll();%0A                    %7D%0A%0A                %7D%0A            %7D);%0A        %7D%0A    %7D%0A%7D%0A

Add executor that will continue to run tasks in a loop