sttp.monad.MonadError#blocking for cats-effect

Hi there!

First of all, thank you for the great library!

I have a question about sttp.monad.MonadError#blocking implementation for cats-effect. If I’m not mistaken, CatsMonadAsyncError uses the default implementation from MonadError:

def blocking[T](t: => T): F[T] = eval(t)

and eval is implemented as follows:

override def eval[T](t: => T): F[T] = F.delay(t)

So, delay is used for blocking actions. It looks a little suspicious for me. Maybe I’m missing something here?

Hm it seems you are right - looks like a bug - can you please report an issue and/or create a PR?

Sure, I’ll do this in a few days.

For the record: This has been fixed in Override blocking inside CatsMonadError by flipp5b · Pull Request #1993 · softwaremill/sttp · GitHub
Thanks @flipp5b :bowing_man:

1 Like