Search code examples
scalascala-catsfs2cats-effect

what is the equivalent of fs2.Scheduler in fs2 (0.10.x) in newer versions


I'm migrating fs2 0.10.x version to version 1.0.0.

Our code uses fs2.Scheduler in from fs2 version 0.10.x.

I don't know what is the equivalent in newer fs2 version 1.0.0.

I went through the migration guide here but couldn't find the migration guidelines for 0.10.x to 1.0.0 or anything similar.

Thanks in advance.


Solution

  • I think you need the migration guide from 0.10 to 1.0 rather than to 0.10 that you pointed to. The relevant section says:

    The new cats.effect.Timer type was introduced in cats-effect 0.10. This type provides much of the same functionality as the fs2.Scheduler type with the added functionality of supporting cancelation of sleeps. Hence, fs2.Scheduler has been removed and all of the stream-specific methods have been moved to the fs2.Stream companion. A Timer[IO] instance is available implicitly for both the JVM and Scala.js, meaning there's no need to allocate and shutdown a timer. Timer instances for other effect types can either be defined manually or derived from the Timer[IO] instance via Timer.derive[F].

    and then there is also a table for specific examples of what mapped where.