Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverted the multithreading improvements (Catalina bug 262) #263

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 3 additions & 8 deletions Framework/src/RemoteData.swift
Expand Up @@ -7,9 +7,6 @@

import Foundation

// Limit the number of simultaneous downloads
private let RemoteDownloadLimiter = DispatchSemaphore(value: 10)

// A URLSession that caches its results
private let RemoteLoadSession: URLSession = {
// Create URL Session Configuration
Expand All @@ -28,6 +25,8 @@ private let RemoteLoadSession: URLSession = {
}()

@objc public class RemoteData : NSObject {
private static let queue = DispatchQueue(label: "io.metaz.RemoteDataQueue")

public let url : URL
public let expectedMimeType : String

Expand Down Expand Up @@ -110,11 +109,7 @@ private let RemoteLoadSession: URLSession = {
let url = self.data!.url
let expectedMimeType = self.data!.expectedMimeType

DispatchQueue.global(qos: .utility).async {
RemoteDownloadLimiter.wait()
defer {
RemoteDownloadLimiter.signal()
}
RemoteData.queue.async {

var downloadData : Data?, responseError : NSError?
let signal = DispatchSemaphore(value: 0)
Expand Down