TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2016 |
SPMSupports SPM | ✗ |
Maintained by Grant Oladipo.
Operator is a wrapper for Grand Central Dispatch written in Swift.
Operator is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Operator"
Operator’s default context model uses the main queue when invoked on the main thread and the global queue when invoked anywhere else. Operator supports contexts in line with the available global queues:
Operator supports the creation of serial and concurrent queues by passing a name with the enums:
Operator.async {
print("Execute asynchronously")
}
which is the same as:
Operator.async(.DefaultContextModel) {
print("Execute asynchronously")
}
To use a different context:
Operator.async(.Background) {
print("Execute in the background")
}
Operator.delay(forSeconds: 10.0) {
print("Execute this 10 seconds later")
}
let customConcurrentContext = Context.Concurrent("com.myapp.mynewconcurrentqueue")
Operator.delay(forSeconds: 10.0, customConcurrentContext) {
print("Execute this 10 seconds later")
}
Operator.sync {
print("Execute this 10 seconds later")
}
Operator.sync(.High) {
print("Execute this 10 seconds later")
}
Operator.tick {
print("Execute this 10 seconds later")
}
Grant Oladipo
t: @kocodude
Operator is available under the MIT license. See the LICENSE file for more info.