Github user ajs6f commented on a diff in the pull request: https://github.com/apache/jena/pull/233#discussion_r110245723 --- Diff: jena-arq/src/main/java/org/apache/jena/sparql/core/mosaic/ThreadProxy.java --- @@ -0,0 +1,100 @@ +package org.apache.jena.sparql.core.mosaic; + +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A Thread proxy which performs actions using one thread (the proxy). + * Internally an ExecutorService with one Thread is used with the action methods execute/submit(Runnable) and submit(Callable<T>). + * Calls to the action methods are FIFO actioned through the LinkedBlockingQueue of the ExecutorService. + * Useful where Thread affinity is required in a parallel processing environment, e.g. .parallelStream().flatMap(...) + * + * @author dick + * + */ +public class ThreadProxy { --- End diff -- That's fine, I'm not talking about the name-- I'm suggesting that `ThreadProxy` might be a natural impl of `ExectutorService`, which would keep it within a publicly-defined contract. Not a big deal, just a thought.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---