Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adrianfilip
Copy link
Contributor

Using the suggestions from #4026

@adamgfraser
Copy link
Contributor

@adrianfilip Looks great! Will review in more detail but can you fix the compilation failures on the documentation?

@adrianfilip
Copy link
Contributor Author

@adamgfraser Thanks. Yes, I am on that now.

import zio.duration.Duration
val duration = Duration.fromNanos(1)
import zio.duration._
val duration = 1.nanos
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to keep Duration.fromNanos just for backward compatibility reasons.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus other ones that existed, like fromMillis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still there but there are a few places where I used the new .nanos instead. Should I revert it in those places?

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 will revert the change to .nanos to make it easier to track changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if you can do it without any changes outside zio.duration._, then it's a great sign users won't have any pains, either!

case Duration.Finite(nanos) =>
case Duration.Infinity => once >>> never.as(1)
case Duration.Zero => forever
case duration =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Through object Finite apply & unapply, we can preserve backward compatibility here and reduce changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. We still want the notion of Finite. I'll make the changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we can make this change backward compatible, it would go a long way to easing migration for 1.0. Thank you!

@adrianfilip
Copy link
Contributor Author

The new PR is: #4034

@adrianfilip adrianfilip deleted the 3685_java_time branch August 4, 2020 20:46
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.

3 participants