-
Couldn't load subscription status.
- Fork 1.4k
add STM warnings #4289
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
add STM warnings #4289
Conversation
|
@adamgfraser can you please review? Would you like me to add a deprecation for |
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.
@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?
|
If there wasn't binary compatibility constraint I'd say remove it. So yes, let's deprecate it. |
b9d4557 to
dc43a06
Compare
dc43a06 to
db5bdcb
Compare
|
@adamgfraser updated wording and deprecated forever |
|
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" |
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.
This should be the version that the deprecated method will be removed, so 2.0.0.
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.
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.StaticAnnotationThere 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.
You're right.
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.
One very minor comment then good to go!
|
Thanks @adamgfraser :) |
doc update because ZSTM repeatWhile/repeatUntil and forever are dangerous