mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Refactor the run loop implementation code into a proper queue abstraction.
ASRunLoopQueue can process a specified number of items per run loop iteration via a block based api.
This commit is contained in:
23
AsyncDisplayKit/ASRunLoopQueue.h
Normal file
23
AsyncDisplayKit/ASRunLoopQueue.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// ASRunLoopQueue.h
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Rahul Malik on 3/7/16.
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASRunLoopQueue<ObjectType> : NSObject
|
||||
|
||||
- (instancetype)initWithRunLoop:(CFRunLoopRef)runloop andHandler:(void(^)(ObjectType dequeuedItem, BOOL isQueueDrained))handlerBlock;
|
||||
|
||||
- (void)enqueue:(ObjectType)object;
|
||||
|
||||
@property (nonatomic, assign) NSUInteger batchSize;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Reference in New Issue
Block a user