turbolift.internals.executor.Scheduler.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of turbolift-core_3 Show documentation
Show all versions of turbolift-core_3 Show documentation
Algebraic Effects for Scala 3
The newest version!
package turbolift.internals.executor
import java.util.concurrent.{Executors, ThreadFactory}
private[internals] object Scheduler:
val instance = Executors.newSingleThreadScheduledExecutor(makeThreadFactory).nn
private def makeThreadFactory: ThreadFactory =
new ThreadFactory:
override def newThread(runnable: Runnable): Thread =
val thread = new Thread(runnable)
thread.setName("turbolift-scheduler")
thread.setDaemon(true)
thread.setPriority(Thread.MAX_PRIORITY)
thread