From 8683b6a8839264a1412e4747b287d3864ea164e0 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Sun, 5 Jul 2015 19:17:29 +0200 Subject: [PATCH] Added ConcurrentDispatchQueue scheduler. --- RxCocoa/RxCocoa.xcodeproj/project.pbxproj | 8 +- .../RxExample/Examples/Dependencies.swift | 2 +- .../Views/WikipediaSearchViewController.swift | 3 - RxExample/RxExample/iOS/Main.storyboard | 8 +- RxSwift/RxSwift.xcodeproj/project.pbxproj | 34 +++-- .../ObserveOnDispatchQueue.swift | 6 +- .../ScheduledSerialSchedulerObserver.swift | 4 +- .../Observables/Observable+Concurrency.swift | 2 +- .../ConcurrentDispatchQueueScheduler.swift | 125 ++++++++++++++++++ .../DispatchQueueSchedulerPriority.swift | 15 +++ .../RxSwift/Schedulers/MainScheduler.swift | 2 +- ...ift => SerialDispatchQueueScheduler.swift} | 11 +- .../Tests/Observable+ConcurrencyTest.swift | 45 ++++--- .../Tests/Observable+TimeTest.swift | 2 +- RxTests/RxTests.xcodeproj/project.pbxproj | 6 +- 15 files changed, 219 insertions(+), 54 deletions(-) create mode 100644 RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift create mode 100644 RxSwift/RxSwift/Schedulers/DispatchQueueSchedulerPriority.swift rename RxSwift/RxSwift/Schedulers/{DispatchQueueScheduler.swift => SerialDispatchQueueScheduler.swift} (96%) diff --git a/RxCocoa/RxCocoa.xcodeproj/project.pbxproj b/RxCocoa/RxCocoa.xcodeproj/project.pbxproj index f62f1afb..67a55c82 100644 --- a/RxCocoa/RxCocoa.xcodeproj/project.pbxproj +++ b/RxCocoa/RxCocoa.xcodeproj/project.pbxproj @@ -363,7 +363,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0610; + LastUpgradeCheck = 0640; ORGANIZATIONNAME = "Krunoslav Zaher"; TargetAttributes = { C81553DD1A98AB4A00C63152 = { @@ -578,7 +578,6 @@ "$(inherited)", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Rx-cfkyozdvlaegqibzixjokeysigeo/Build/Products/Debug-iphoneos", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Rx-cfkyozdvlaegqibzixjokeysigeo/Build/Products/Release-iphoneos", - "/Users/kzaher/Projects/Rx/RxSwift/build/Debug-iphoneos", ); INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -602,7 +601,6 @@ "$(inherited)", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Rx-cfkyozdvlaegqibzixjokeysigeo/Build/Products/Debug-iphoneos", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Rx-cfkyozdvlaegqibzixjokeysigeo/Build/Products/Release-iphoneos", - "/Users/kzaher/Projects/Rx/RxSwift/build/Debug-iphoneos", ); INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -668,7 +666,6 @@ "$(inherited)", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Rx-cfkyozdvlaegqibzixjokeysigeo/Build/Products/Debug-iphoneos", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/Rx-cfkyozdvlaegqibzixjokeysigeo/Build/Products/Release-iphoneos", - "/Users/kzaher/Projects/Rx/RxSwift/build/Debug-iphoneos", ); INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -683,6 +680,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -701,6 +699,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -720,6 +719,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; diff --git a/RxExample/RxExample/Examples/Dependencies.swift b/RxExample/RxExample/Examples/Dependencies.swift index 1acd1b7f..38bd8900 100644 --- a/RxExample/RxExample/Examples/Dependencies.swift +++ b/RxExample/RxExample/Examples/Dependencies.swift @@ -15,7 +15,7 @@ class Dependencies { let URLSession = NSURLSession.sharedSession() let backgroundWorkScheduler: ImmediateScheduler - let mainScheduler: DispatchQueueScheduler + let mainScheduler: SerialDispatchQueueScheduler let wireframe: Wireframe private init() { diff --git a/RxExample/RxExample/Examples/WikipediaImageSearch/Views/WikipediaSearchViewController.swift b/RxExample/RxExample/Examples/WikipediaImageSearch/Views/WikipediaSearchViewController.swift index 59d90bde..637a5688 100644 --- a/RxExample/RxExample/Examples/WikipediaImageSearch/Views/WikipediaSearchViewController.swift +++ b/RxExample/RxExample/Examples/WikipediaImageSearch/Views/WikipediaSearchViewController.swift @@ -24,9 +24,6 @@ class WikipediaSearchViewController: ViewController { override func viewDidLoad() { super.viewDidLoad() - let a = Subject() - sendNext(a, 1) - let resultsTableView = self.searchDisplayController!.searchResultsTableView let searchBar = self.searchDisplayController!.searchBar diff --git a/RxExample/RxExample/iOS/Main.storyboard b/RxExample/RxExample/iOS/Main.storyboard index 2ec56111..3317be11 100644 --- a/RxExample/RxExample/iOS/Main.storyboard +++ b/RxExample/RxExample/iOS/Main.storyboard @@ -262,8 +262,8 @@ -