Atom: add method to run computation on inner value (atomic)? #958
StefanBertels
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
If there are side-effects within an atom's Atomic reads are always possible using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use this extension method to run a computation on the
Atom
content in an atomic way:I call this like
myAtom.Eval(_ => _.GetCurrentData())
.My use case is a
T
which represents a ressource that isn't thread-safe (e.g. an OS handle -- might be closed on another thread => lock necessary).R
is a value object.Question: Is this extension a "missing" feature in LanguageExt or is it maybe just a bad idea at all?
Beta Was this translation helpful? Give feedback.
All reactions