Skip to content

Commit

Permalink
Fix how blocking is implemented in CatsMonadAsyncError
Browse files Browse the repository at this point in the history
  • Loading branch information
kciesielski committed Nov 9, 2023
1 parent 1dc34c4 commit e0a0f0f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ import sttp.monad.{Canceler, MonadAsyncError}
class CatsMonadAsyncError[F[_]](implicit F: Async[F]) extends CatsMonadError[F] with MonadAsyncError[F] {
override def async[T](register: ((Either[Throwable, T]) => Unit) => Canceler): F[T] =
F.async(cb => F.delay(register(cb)).map(c => F.delay(c.cancel()).some))

override def blocking[T](t: => T): F[T] =
F.blocking(t)
}

0 comments on commit e0a0f0f

Please sign in to comment.