Skip to content

Commit

Permalink
Cosmetics.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kloch committed Sep 11, 2023
1 parent 102f9fe commit 279fc23
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions std/shared/src/main/scala/cats/effect/std/Dispatcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,15 @@ trait Dispatcher[F[_]] extends DispatcherPlatform[F] {
* Submits an effect to be executed with fire-and-forget semantics.
*/
def unsafeRunAndForget[A](fa: F[A]): Unit =
unsafeToFutureCancelable(fa)
._1
.onComplete {
case Failure(ex) => ex.printStackTrace()
case _ => ()
}(parasiticEC)
unsafeToFuture(fa).onComplete {
case Failure(ex) => ex.printStackTrace()
case _ => ()
}(parasiticEC)

// package-private because it's just an internal utility which supports specific implementations
// anyone who needs this type of thing should use unsafeToFuture and then onComplete
private[std] def unsafeRunAsync[A](fa: F[A])(cb: Either[Throwable, A] => Unit): Unit =
unsafeToFutureCancelable(fa)._1.onComplete(t => cb(t.toEither))(parasiticEC)
unsafeToFuture(fa).onComplete(t => cb(t.toEither))(parasiticEC)
}

object Dispatcher {
Expand Down

0 comments on commit 279fc23

Please sign in to comment.