Skip to content

crspybits/Conditions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conditions for Swift Concurrency actors

Straight out of the box Swift Concurrency actors do not support solutions to the readers writers problems where you'd like multiple concurrent readers. For example:

actor ReadersWriters {
    private var myData = [String: String]()

    func reader(access: ([String: String]) -> ()) async {
        access(myData)
    }

    func writer(set value: String, of key: String) async {
        myData[key] = value
    }
}

In that actor, only a single reader can be active at a time. We might like, however, to enable concurrent reader access, but only single writer access.

It is the purpose of the Condition actor provided by this package to allow for these kinds of solutions. See the tests in this package for examples.

NOTES:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages