我正在将 fs2 0.10.x 版本迁移到 1.0.0 版本。
我们的代码使用 fs2.Scheduler
来自 fs2 版本 0.10.x。
我不知道更新的 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]
.
然后还有一个表格,用于说明什么映射到哪里的具体示例。
关于scala - 新版本的 fs2 (0.10.x) 中的 fs2.Scheduler 等效于什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54079391/