新版本中 fs2 (0.10.x) 中 fs2.Scheduler 的等价物是什么
what is the equivalent of fs2.Scheduler in fs2 (0.10.x) in newer versions
我正在将 fs2 0.10.x 版本迁移到 1.0.0.
版本
我们的代码在 fs2 版本 0.10.x.
中使用 fs2.Scheduler
我不知道较新的 fs2 版本 1.0.0 中的等价物是什么。
我浏览了迁移指南 here 但找不到从 0.10.x 到 1.0.0 或任何类似内容的迁移指南。
提前致谢。
我认为您需要 migration guide from 0.10 to 1.0 而不是您指向的 到 0.10。相关部分说:
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]
.
然后还有一个 table 用于映射到哪里的具体示例。
我正在将 fs2 0.10.x 版本迁移到 1.0.0.
版本我们的代码在 fs2 版本 0.10.x.
中使用fs2.Scheduler
我不知道较新的 fs2 版本 1.0.0 中的等价物是什么。
我浏览了迁移指南 here 但找不到从 0.10.x 到 1.0.0 或任何类似内容的迁移指南。
提前致谢。
我认为您需要 migration guide from 0.10 to 1.0 而不是您指向的 到 0.10。相关部分说:
The new
cats.effect.Timer
type was introduced in cats-effect 0.10. This type provides much of the same functionality as thefs2.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 thefs2.Stream
companion. ATimer[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 theTimer[IO]
instance viaTimer.derive[F]
.
然后还有一个 table 用于映射到哪里的具体示例。