added limit to app asset request

This commit is contained in:
Diego Waxemberg 2015-05-28 23:37:55 -07:00
parent 6b97af13bf
commit 2972d40d92

View File

@ -19,11 +19,14 @@
NSMutableDictionary* _imageCache; NSMutableDictionary* _imageCache;
} }
static const int MAX_REQUEST_COUNT = 4;
- (id) initWithCallback:(id<AppAssetCallback>)callback { - (id) initWithCallback:(id<AppAssetCallback>)callback {
self = [super init]; self = [super init];
_callback = callback; _callback = callback;
_opQueue = [[NSOperationQueue alloc] init];
_imageCache = [[NSMutableDictionary alloc] init]; _imageCache = [[NSMutableDictionary alloc] init];
_opQueue = [[NSOperationQueue alloc] init];
[_opQueue setMaxConcurrentOperationCount:MAX_REQUEST_COUNT];
return self; return self;
} }