80f638b56a
Adds support for scheduling commands to run at a later time on another thread pool in the current thread's context: ```java Runnable someCommand = () -> {System.err.println("Demo");}; someCommand = threadPool.getThreadContext().preserveContext(someCommand); threadPool.schedule(timeValueMinutes(1), Names.GENERAL, someCommand); ``` This happens automatically for calls to `threadPool.execute` but `schedule` and `scheduleWithFixedDelay` don't do that, presumably because scheduled tasks are usually context-less. Rather than preserve the current context on all scheduled tasks this just makes it possible to preserve it using the syntax above. To make this all go it moves the Runnables that wrap the commands from EsThreadPoolExecutor into ThreadContext. This, or something like it, is required to support reindex throttling. |
||
---|---|---|
.. | ||
src/main | ||
build.gradle | ||
version.properties |