Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Upgrade to ZIO 2.0 #450

wants to merge 8 commits into from

Conversation

zhrebicek
Copy link
Contributor

@zhrebicek zhrebicek commented Dec 17, 2021

It should take care of #422

Still missing some compilation errors.

@zhrebicek zhrebicek changed the base branch from master to series/2.x December 17, 2021 08:51
@zhrebicek zhrebicek changed the title Series/2.x Series/2.x #422 Dec 17, 2021
@zhrebicek zhrebicek changed the title Series/2.x #422 Series/2.x (#422) Dec 17, 2021
@zhrebicek zhrebicek mentioned this pull request Dec 17, 2021
@zhrebicek zhrebicek changed the title Series/2.x (#422) Upgrade to ZIO 2.0 Dec 17, 2021
@zhrebicek zhrebicek force-pushed the series/2.x branch 3 times, most recently from fd07825 to b2cbc47 Compare December 17, 2021 14:27
@@ -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
Copy link
Contributor Author

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] ──────────────────────────────────────────────────────────────────────

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.

Copy link
Contributor Author

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.

@zhrebicek
Copy link
Contributor Author

All tests are passing but this one

[info] - DatagramChannelSpec
[info]   - read/write
[info] Timeout of 1 m exceeded.

@zhrebicek zhrebicek marked this pull request as ready for review December 17, 2021 17:14
@zhrebicek zhrebicek requested a review from a team as a code owner December 17, 2021 17:14
@adamgfraser adamgfraser mentioned this pull request Jan 20, 2022
@zhrebicek
Copy link
Contributor Author

@adamgfraser finished it in his own PR. Thanks again.

@zhrebicek zhrebicek closed this Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants