Port code to ZIO2
ZIO 2 was released earlier that year (2022-06-24 - see https://degoes.net/articles/zio-2.0). Since then, ZIO maintenairs have been eagered to migrate library to ZIO 2 and to stop support on ZIO 1. The change are important (but with luck, not in part of the framework we are using) and the core dev have a very aggressive policy toward EOL of community support of previous versions.
All that means that we don't have much time if we want to still have some updates and if we want to be able to use recent version of ZIO libs (and libs are very young, so a one-year-old version is obsolete and misses major features).
Given that 7.2 dev cycle was already well advanced (and I had blocking bugs for rudder until the very last weeks of ZIO 2 beta), we weren't able to migrate for that release. But we really, really need to migrate for 7.3, or else suffer a couple of difficult years for dev/maintenance.
There is an excellent migration guide here: https://zio.dev/guides/migrate/zio-2.x-migration-guide/
In our case, the main aspect are:
- we don't need to use
blocking effect everywhere, now ZIO managed it all by itself. In ZIO 2.0.0, the perf are not that much different (which is already a massive evolution, because we had to be extremelly specific on some hot points, and now it's not needed anymore)
.effect were rename to
.attempt, and there is a lot of other renaming. Nothing hard, it's just breaking everything everywhere. We need to use the same change, at least for effect, else we will get lost on when to use the one or the other.
bracket are removed because now we have
Scope. Limited impact in our use cases (just copy what the migration guide says for that)
- parallelism is not "foreachParN" but now "foreach(...).withParallelism(n)"