-
Couldn't load subscription status.
- Fork 1.4k
Make parts of ZManaged private #2124
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
Conversation
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.
Almost there! Nice work!
| /** | ||
| * Extracts [[Reservation]] from within. | ||
| */ | ||
| final def unapply[E, A](v: Managed[E, A]): Option[ZIO[Any, E, Reservation[Any, E, A]]] = |
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.
We can skip unapply. No real use for it
| * some checked error, as per the type of the functions provided by the resource. | ||
| */ | ||
| final case class ZManaged[-R, +E, +A](reserve: ZIO[R, E, Reservation[R, E, A]]) { self => | ||
| final class ZManaged[-R, +E, +A] private (val reserve: ZIO[R, E, Reservation[R, E, A]]) extends Serializable { self => |
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.
Let's make reserve just a constructor parameter, and not a field:
| final class ZManaged[-R, +E, +A] private (val reserve: ZIO[R, E, Reservation[R, E, A]]) extends Serializable { self => | |
| final class ZManaged[-R, +E, +A] private (reservation: ZIO[R, E, Reservation[R, E, A]]) extends Serializable { self => |
And add an accessor method:
def reserve: ZIO[R, E, Reservation[R, E, A]] = reservation|
@iravid Thank you for your review, I addressed the issues. |
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.
Great work! Thank you!
* Make parts of ZManaged private * Make ZManaged serializable * Address code remarks
* Make parts of ZManaged private * Make ZManaged serializable * Address code remarks
closes #2076