Skip to content

Instantly share code, notes, and snippets.

@charmygarg
Last active June 15, 2017 04:50
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 charmygarg/8db6a32bf33d4a29b8899890b4605891 to your computer and use it in GitHub Desktop.
Save charmygarg/8db6a32bf33d4a29b8899890b4605891 to your computer and use it in GitHub Desktop.
Monix Scheduler Once Example 1
import java.util.concurrent.TimeUnit
import monix.execution.Scheduler.{global => scheduler}
import scala.concurrent.duration._
object MonixScheduler extends App {
val delayOnce = scheduler.scheduleOnce(
2, TimeUnit.SECONDS,
new Runnable {
def run(): Unit = {
println("Schedule Example 1")
}
})
Thread.sleep(20000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment