KSEncore 1.0.2

KSEncore 1.0.2

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
Release上次发布2015年5月

Kevin Sylvestre维护。



KSEncore 1.0.2

  • 作者:
  • Kevin Sylvestre

Encore

用法

Encore用于排队回调。它确保单个执行器运行块时,其他回调会阻塞。

+ (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);
                }];
            });
        });
    }];
}

安装

Encore通过CocoaPods可用。要安装它,请将以下行添加到Podfile:

pod "KSEncore"

作者:

Kevin Sylvestre, [email protected]

许可证:

Encore可在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。