Skip to content

Instantly share code, notes, and snippets.

@adamw
Created May 17, 2019 13:06
Show Gist options
  • Save adamw/d88840817d236971874ca7b23f8bb9e6 to your computer and use it in GitHub Desktop.
Save adamw/d88840817d236971874ca7b23f8bb9e6 to your computer and use it in GitHub Desktop.
import monix.eval.Task
import monix.execution.Scheduler.Implicits.global
object Hello extends App {
val task = Task(
println(s"Hello, world from thread: ${Thread.currentThread().getName}!")
)
(for {
fiber1 <- task.start
_ <- task
_ <- fiber1.join
} yield ()).runSyncUnsafe()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment