org.gerweck.scala.util.io.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gerweck-utils-java8_2.10 Show documentation
Show all versions of gerweck-utils-java8_2.10 Show documentation
Miscellaneous utility functionality for Scala
package org.gerweck.scala.util
import scala.concurrent.ExecutionContext
import java.util.concurrent.Executors
/**
*
* @author Sarah Gerweck
*/
package object io {
private[this] final val streamThreadPrefix = "scala-utils-iothread-"
private[this] final val ioThreadPriority = Thread.NORM_PRIORITY - 1
lazy val ioExecutorContext = {
val threadFactory = {
ThreadFactories({streamThreadPrefix + (_: Int)}, daemon = true, priority = ioThreadPriority)
}
ExecutionContext.fromExecutor(Executors.newCachedThreadPool(threadFactory))
}
}