-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to ZIO 2.0 #450
Upgrade to ZIO 2.0 #450
Conversation
4fe7823
to
b4ed18a
Compare
fd07825
to
b2cbc47
Compare
b2cbc47
to
2c0112e
Compare
@@ -61,8 +61,10 @@ package object nio { | |||
* The effect to run in a forked fiber. The resource is only valid within this effect. | |||
*/ | |||
def useForked[R2 <: R, E2 >: E, B](f: A => ZIO[R2, E2, B]): ZIO[R2, E, Fiber[E2, B]] = | |||
ReleaseMap.make.flatMap { releaseMap => | |||
managed.zio.provideSome[R]((_, releaseMap)).flatMap { case (finalizer, a) => f(a).onExit(finalizer).fork } | |||
ReleaseMap.make.flatMap { releaseMap => // TODO fix this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure with this as it throws this warning at me
warn] ──── ZLAYER WARNING ──────────────────────────────────────────────────
[warn]
[warn] You have provided more than is required.
[warn] You may remove the following layer:
[warn]
[warn] 1. ZLayer.succeed(releaseMap)(Tag(classOf[zio.ZManaged$$ReleaseMap], LightTypeTag.parse(-438314458, "\u0004\u0000\u0001\u0017zio.ZManaged.ReleaseMap\u0001\u0002\u0003\u0000\u0000\fzio.ZManaged\u0001\u0001", "\u0000\u0001\u0004\u0000\u0001\u0017zio.ZManaged.ReleaseMap\u0001\u0002\u0003\u0000\u0000\fzio.ZManaged\u0001\u0001\u0001\u0004\u0000\u0001\u0014java.io.Serializable\u0001\u0001\u0001\u0000\u0001\u0090\u0002\u0001\u0002\u0003\u0000\u0000\u0090\u0003\u0001\u0001\u0001\u0000\u0001\u0090\u0004\u0001\u0001", 11)), {
[warn] final class $anon extends _root_.zio.`package`.IsNotIntersection[zio.ZManaged.ReleaseMap];
[warn] new $anon()
[warn] }, "zio.nio.package.ManagedOps.useForked(package.scala:65)".asInstanceOf[_root_.zio.internal.stacktracer.Tracer.instance.Type with _root_.zio.internal.stacktracer.Tracer.Traced])
[warn]
[warn] ──────────────────────────────────────────────────────────────────────
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhrebicek Have you tried just removing .provideSome[R](ZLayer.succeed(releaseMap))
from the code? It's probably more complicated than that, but just want to make sure you've tried the easiest thing before troubleshooting further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swoogles it seems to make compiler happy, but I should write some test around it if it behaves as expected. And I am not sure when I would have time for it.
All tests are passing but this one
|
@adamgfraser finished it in his own PR. Thanks again. |
It should take care of #422
Still missing some compilation errors.