Closed okla closed 5 years ago
Hello @okla; thanks for contributing.
The project is not compiling; some more work is needed since using sync requires explicit capture semantics.
I kept the mutate method synchronous for consistency with read/write access and I would like to keep it like that, but I am really open to add a second mutateAsync method.
Would you mind pushing those changes?
Hey again.
Using async requires an escaping closure. Since the wrapper is a struct we cannot reference itself because it is a value type. I might consider switching to classes if this becomes an important/requested feature, but for now I think this is not needed, hence i am closing the PR.
Thanks anyways for the idea! Regards.
Reads are still concurrent (from different threads), but writes won't block the calling thread.