public final class ComputerSubmissionHelper extends Object
|Constructor and Description|
|Modifier and Type||Method and Description|
public static Future<ComputerResult> runWithBackgroundThread(<any> closure, String threadNameSuffix)
Executors.newSingleThreadExecutor(ThreadFactory)configured make threads that behave like the caller, invokes a closure on it, and shuts it down.
This is intended to serve as an alternative to
which is used by
CompletableFuture.supplyAsync(Supplier) (among other methods).
The single threaded executor created by this method contains a thread
with the same context classloader and thread group as the thread that called
this method. Threads created in this method also have predictable behavior when
Thread.setContextClassLoader(ClassLoader) is invoked; threads in the
common pool throw a SecurityException if the JVM has a security manager configured.
The name of the thread created by this method's internal executor is the concatenation of
closure- arbitrary code that has exclusive use of the supplied executor
threadNameSuffix- a string appended to the executor's thread's name
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.