File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import Foundation
9
9
10
- // Limit the number of simultaneous downloads
11
- private let RemoteDownloadLimiter = DispatchSemaphore ( value: 10 )
12
-
13
10
// A URLSession that caches its results
14
11
private let RemoteLoadSession : URLSession = {
15
12
// Create URL Session Configuration
@@ -28,6 +25,8 @@ private let RemoteLoadSession: URLSession = {
28
25
} ( )
29
26
30
27
@objc public class RemoteData : NSObject {
28
+ private static let queue = DispatchQueue ( label: " io.metaz.RemoteDataQueue " )
29
+
31
30
public let url : URL
32
31
public let expectedMimeType : String
33
32
@@ -110,11 +109,7 @@ private let RemoteLoadSession: URLSession = {
110
109
let url = self . data!. url
111
110
let expectedMimeType = self . data!. expectedMimeType
112
111
113
- DispatchQueue . global ( qos: . utility) . async {
114
- RemoteDownloadLimiter . wait ( )
115
- defer {
116
- RemoteDownloadLimiter . signal ( )
117
- }
112
+ RemoteData . queue. async {
118
113
119
114
var downloadData : Data ? , responseError : NSError ?
120
115
let signal = DispatchSemaphore ( value: 0 )
You can’t perform that action at this time.
0 commit comments