-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
TxnLocal should get some of the methods from Ref:
- the access shortcuts
apply()andupdate(v) - read+write forms
swap,transform,transformIfDefined,+=,-=, and*=
I think compareAndSet (and other Ref methods whose success or failure is determined by concurrent accesses) would be misleading, because TxnLocal instances are isolated.
Also, overriding initialValue should perhaps be replaced with a by-name parameter to a factory method. This is more Scala-ish, but makes it more difficult to get access to the current Txn context.
Reactions are currently unavailable