From 2972d40d92fdd044a05f1d08680e1b740f15ff52 Mon Sep 17 00:00:00 2001 From: Diego Waxemberg Date: Thu, 28 May 2015 23:37:55 -0700 Subject: [PATCH] added limit to app asset request --- Limelight/Network/AppAssetManager.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Limelight/Network/AppAssetManager.m b/Limelight/Network/AppAssetManager.m index 9395f7c..1ce5077 100644 --- a/Limelight/Network/AppAssetManager.m +++ b/Limelight/Network/AppAssetManager.m @@ -19,11 +19,14 @@ NSMutableDictionary* _imageCache; } +static const int MAX_REQUEST_COUNT = 4; + - (id) initWithCallback:(id)callback { self = [super init]; _callback = callback; - _opQueue = [[NSOperationQueue alloc] init]; _imageCache = [[NSMutableDictionary alloc] init]; + _opQueue = [[NSOperationQueue alloc] init]; + [_opQueue setMaxConcurrentOperationCount:MAX_REQUEST_COUNT]; return self; }