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 thanIO
Task
is smarter and automatic about thread scheduling fairnessTask
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.