Skip to content

Commit

Permalink
#3 Using Await.result to block instead of runSyncMaybe.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed Jun 17, 2017
1 parent 7f48bd7 commit afd403d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import fs2.Scheduler
import monix.eval.Task
import monix.execution.Scheduler.Implicits.global

import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext}
import scala.concurrent.duration.{Duration, FiniteDuration}

object MonixEffectScheduler extends EffectScheduler[Task] {

Expand All @@ -16,6 +16,6 @@ object MonixEffectScheduler extends EffectScheduler[Task] {
}

override def unsafeRunSync(effect: Task[Unit]) = {
effect.runSyncMaybe
Await.result(effect.runAsync, Duration.Inf)
}
}

0 comments on commit afd403d

Please sign in to comment.