Latest | 1.0.2 |
---|---|
Homepage | https://github.com/ksylvest/encore |
License | MIT |
Platforms | ios 7.0 |
Authors |
Encore
Usage
Encore is for queueing callbacks. It ensures that a single executor runs a block while other callbacks block.
+ (void)process:(void(^)(NSError *error))callback
{
static KSEncore *encore;
static dispatch_once_t token;
dispatch_once(&token, ^{ encore = [KSEncore new]; });
[encore queue:callback block:^{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// ...
dispatch_async(dispatch_get_main_queue(), ^{
[encore flush:^(void (^callback)(NSError *error)) {
callback(error);
}];
});
});
}];
}
Installation
Encore is available through CocoaPods. To install it add the following line to your Podfile:
pod "KSEncore"
Author
Kevin Sylvestre, [email protected]
License
Encore is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "KSEncore", "version": "1.0.2", "summary": "Encore eliminates duplicate calls by queueing callbacks.", "description": " * Queue up callbacks using `queue:block:`n * Flush callbacks using `flush:`n", "homepage": "https://github.com/ksylvest/encore", "license": "MIT", "authors": { "Kevin Sylvestre": "[email protected]" }, "source": { "git": "https://github.com/ksylvest/encore.git", "tag": "1.0.2" }, "platforms": { "ios": "7.0" }, "source_files": "Pod/Classes/**/*" }
Mon, 29 Feb 2016 21:08:03 +0000