10

This simplified case is where my question happen at...

object Main extends IOApp{
 def run(args:Seq[String]): IO[ExitCode]={
    Task{...}
     .to[IO]
     .as(ExitCode.Success)
 }
}

Another option is Await.result(task), however which sounds not quite line up with IOApp's practice.

what i know

According to this great post Monix vs Cats Effect
I see differences between Task IO are:

  • Task API is richer than IO
  • Task is smarter and automatic about thread scheduling fairness
  • Task get more cancelable options
  • and more ...

question and my opinion

What I lost after I convert Monix Task into Cats IO?

It seems to work fine, with Task.gather and timeout-- all those Task specific things.
So What I lost in conversion ?
If no, then no reason to have more than one data type created.

So given the differences is that means that I lost the scheduling fairness after conversing Task to IO ?


Well I should have verified it by myself but I don't known how to test it the fairness.

Sergey Romanovsky
  • 4,216
  • 4
  • 25
  • 27
WeiChing 林煒清
  • 4,452
  • 3
  • 30
  • 65

1 Answers1

0

Monix Task isn't updated for cats-effect 3, nor is it likely to ever be, so at this point it's a moot question - if you want to use the current ecosystem, you use IO

The monix author is a major contributor to cats-effect, and at this point there's little to no functionality present in monix task which can't be also done with IO.

Daenyth
  • 35,856
  • 13
  • 85
  • 124