Instance Methodpointfreeco.swift-concurrency-extras 1.3.1ConcurrencyExtras
setValue(_:)
Overwrite the isolated value with a new value.
This declaration is deprecated: Use 'LockIsolated' instead.
func setValue(_ newValue: @autoclosure () throws -> Value) rethrows
Parameters
- newValue
The value to replace the current isolated value with.
// Isolate an integer for concurrent read/write access:
let count = ActorIsolated(0)
func reset() async {
// Reset it:
await self.count.setValue(0)
}