Sam Schilling
09/27/2019, 8:26 PMWorker.execute
with TransferMode.SAFE
?
Basically I want to keep a global cache as a singleton instance and have the background workers able to add things to the cache. But I think that may violate mutable XOR global.Jeremy
09/27/2019, 8:29 PMJeremy
09/27/2019, 8:31 PMSam Schilling
09/27/2019, 8:32 PMbasher
09/27/2019, 8:36 PM@SharedImmutable
val someRef = AtomicReference<SomObject?>(null)
basher
09/27/2019, 8:37 PMsomeRef.value = newValue.freeze()
(has to be frozen)Sam Schilling
09/27/2019, 8:37 PMsomeRef.value
?Jeremy
09/27/2019, 8:41 PMJeremy
09/27/2019, 8:43 PMDetachedObjectGraph
should allow you to transfer ownership and mutateSam Schilling
09/27/2019, 8:52 PMbasher
09/27/2019, 8:52 PMsomeRef.value
anymore, correctJeremy
09/27/2019, 9:03 PMSam Schilling
09/27/2019, 9:04 PMJeremy
09/27/2019, 9:06 PM