
rx.ops.AkkaScheduler.scala Maven / Gradle / Ivy
The newest version!
package rx.ops
import akka.actor.ActorSystem
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.ExecutionContext
/**
* A [[Scheduler]] that wraps an `ActorSystem`'s scheduler.
*/
class AkkaScheduler(system: ActorSystem) extends Scheduler {
def scheduleOnce[T](interval: FiniteDuration)
(thunk: => T)
(implicit executor: ExecutionContext): Unit = {
system.scheduler.scheduleOnce(interval)(thunk)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy