Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Fix blocking implementation for CatsMonadAsyncError #3309

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ class CatsMonadError[F[_]](implicit F: Sync[F]) extends MonadError[F] {
override def suspend[T](t: => F[T]): F[T] = F.defer(t)
override def flatten[T](ffa: F[F[T]]): F[T] = F.flatten(ffa)
override def ensure[T](f: F[T], e: => F[Unit]): F[T] = F.guaranteeCase(f)(_ => e)
override def blocking[T](t: => T): F[T] = F.blocking(t)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ import sttp.tapir.integ.cats.effect.CatsMonadError
private 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 => Some(F.delay(c.cancel()))))

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