-
Notifications
You must be signed in to change notification settings - Fork 521
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 semantically blocking get
in AtomicCell.
#3635
Comments
Thanks for opening the issue! We had a discussion about this topic in #3518 (comment). Would it be possible to explain your usecase in more detail? |
Sure. I have multiple fs2 Streams running concurrently, accessing some The case is actually very similiar to the new test written in #3518 but you would expect to wait until the big IO finishes. A very crude snippet would look like this:
|
How do you handle this scenario? Wouldn't it break your semantics? Why or why not?
|
You are right, it would break in a general case like yours. But what about the case if you want to pause |
Right.
In that case, it sounds like you are designing a concurrent data structure with different semantics than
Another possibility to achieve these semantics: you can create a https://typelevel.org/cats-effect/api/3.x/cats/effect/std/Hotswap.html |
If I understand correctly, the discussion concluded, that it's fine as it is, so I'll close this. (Feel free to reopen, if I'm misunderstanding.) |
I have a use case where I need to block possible incoming
AtomicCell#get
because of possibly long runningevalUpdate
.Can we add it back, maybe as a new method on the AtomicCell?
The text was updated successfully, but these errors were encountered: