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

Skip to content

Conversation

@bertlebee
Copy link
Contributor

doc update because ZSTM repeatWhile/repeatUntil and forever are dangerous

@bertlebee
Copy link
Contributor Author

@adamgfraser can you please review? Would you like me to add a deprecation for forever as well?

Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

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

@robmwalsh Looks good!

I might say a little more about why this is the case so it doesn't just seem like an arbitrary gotcha. Something like. Warning: because STM describes a single atomic transaction, repeatUntil will continuously repeat the transaction until the specified condition is true without yielding back to the ZIO Runtime...

As far as forever I think it is okay to deprecate it. @mijicd What do you think?

@mijicd
Copy link
Member

mijicd commented Oct 7, 2020

If there wasn't binary compatibility constraint I'd say remove it. So yes, let's deprecate it.

@bertlebee
Copy link
Contributor Author

@adamgfraser updated wording and deprecated forever

@bertlebee
Copy link
Contributor Author

Can this be merged now?

*/
@deprecated(
"Repeating until failure doesn't make sense in the context of STM because it will always roll back the transaction",
"1.0.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the version that the deprecated method will be removed, so 2.0.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the scaladoc for @deprecated it's when it was first deprecated. If zio does things differently that's fine but this should probably be documented somewhere. I can't find any mention of this in the repo. Do you still want me to change it?

/**
*...
*@param  since   a string identifying the first version in which the definition was deprecated
*...
*/
class deprecated(message: String = "", since: String = "") extends scala.annotation.StaticAnnotation

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right.

Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

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

One very minor comment then good to go!

@adamgfraser adamgfraser merged commit b226a7b into zio:master Oct 16, 2020
@bertlebee
Copy link
Contributor Author

Thanks @adamgfraser :)

@bertlebee bertlebee deleted the stm-warnings branch October 16, 2020 00:58
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