3 ms·
If you want to use something like this right now (with a threadsafe bonus) concurrent-ruby has some useful specialized structs that offer similar behavior: * I
by prescriptivist 4y ago
If you want to use something like this right now (with a threadsafe bonus) concurrent-ruby has some useful specialized structs that offer similar behavior:
* ImmutableStruct: Immutable struct where values are set at construction and cannot be changed later.
* MutableStruct: Synchronized, mutable struct where values can be safely changed at any time.
* SettableStruct: Synchronized, write-once struct where values can be set at most once, either at construction or any time thereafter.
https://github.com/ruby-concurrency/concurrent-ruby https://github.com/ruby-concurrency/concurrent-ruby
- sacnoradhq 4y agoYep. There was no reason to add trivial functionality that already exists. Just something else to go wrong, support, and add bloat.