gpt4 book ai didi

scala - 新版本的 fs2 (0.10.x) 中的 fs2.Scheduler 等效于什么

转载 作者:行者123 更新时间:2023-12-01 11:14:38 24 4
gpt4 key购买 nike

我正在将 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 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].

然后还有一个表格,用于说明什么映射到哪里的具体示例。

关于scala - 新版本的 fs2 (0.10.x) 中的 fs2.Scheduler 等效于什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54079391/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com