Skip to content

Instantly share code, notes, and snippets.

@ahinchman1
Last active October 28, 2022 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahinchman1/f5f7b4f5c1e8b66ff1f29a134883ff26 to your computer and use it in GitHub Desktop.
Save ahinchman1/f5f7b4f5c1e8b66ff1f29a134883ff26 to your computer and use it in GitHub Desktop.
Fixed
import java.util.concurrent.*
private val threadFactory = object : ThreadFactory {
private val count = AtomicInteger(1)
override fun newThread(r: Runnable): Thread = Thread(r, "Thread #${count.getAndIncrement()}")
}
@Singleton
class TopologicalProcessor {
var tileMapThreadPoolExecutor = ThreadPoolExecutor(
corePoolSize = 3,
maximumPoolSize = 3,
keepAliveTime = 0L,
unit = TimeUnit.SECONDS,
workQueue = LinkedBlockingQueue<Runnable>(),
threadFactory = threadFactory
)
/* Removed for brevity */
/* companion object { ... } */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment