TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2016 |
SPMSupports SPM | ✗ |
Maintained by Khoa Pham.
Interacting with GCD
To run the example project, clone the repo, and run pod install
from the Example directory first.
Enum conforms to RawRepresentable
Provided queue
Queue.main
Queue.background
Easy to create queue
let queue = Queue(name: "queue", attribute: Attribute.Serial, qualityOfService: QualityOfService.UserInteractive)
sync {
print("action goes inside main queue using dispatch_sync")
}
async(Queue.background) {
print("action goes inside background queue using dispatch_async")
}
after(5) {
print("action goes inside main queue after 5 seconds using dispatch_after")
}
Every action is a Task, which can be chained. A Task is like a Pull Signal
let task = on {
print("action on main queue")
}
task.run()
let background = Queue(name: "background", attribute: Attribute.Serial, qualityOfService: QualityOfService.Background)
on(background) {
print("on background")
}
.delay(1) {
print("after delay")
}.on(Queue.main) {
print("on main")
}.run()
after
and delay
defaults to main queue
if no queue is provided !!on
and delay
Performer is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Performer"
Credit goes to
Khoa Pham, [email protected]
Performer is available under the MIT license. See the LICENSE file for more info.