TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Justin DeWind.
JSGCDDipatcher is a small Objective-C wrapper around GCD that provides a simple interface to submit blocks to GCD either on the serial or concurrent queue.
[[JSGCDDipatcher sharedDispatcher] dispatch:^{
// Busy Work
}];
[[JSGCDDipatcher sharedDispatcher] dispatch:^{
// Busy Work
} priority:DISPATCH_QUEUE_PRIORITY_DEFAULT];
[target dispatchOnSerialQueue:^{
// Busy serial work
}];
[[JSGCDDipatcher sharedDispatcher] submitSerialQueueCompletionListener:^{
// Serial jobs complete
}];
Invoke this method when you have a task that is important and should not be interrupted if the application is suddenly placed in the background.
[target dispatchBackgroundTask:^(UIBackgroundTaskIdentifier identifier) {
if(identifier == UIBackgroundTaskInvalid) {
// Almost out of time to run the task
} else {
// Good to go
}
} priority:DISPATCH_QUEUE_PRIORITY_DEFAULT];