Skip to content

TxnLocal enhancements #33

@nbronson

Description

@nbronson

TxnLocal should get some of the methods from Ref:

  • the access shortcuts apply() and update(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions