RxObservableQueue
With RxObservableQueue, you can mange Observables as Queue. RxObservableQueue is thin wrapper for containing emitted objects and emitting objects when desired.
Features
Requirements
- iOS 8.0+
- Xcode 9.3+
- RxSwift
Installation
RxObservableQueue is available through CocoaPods and Carthage.
CocoaPods
To install, simply add the following line to your Podfile
:
platform :ios, '11.0'
use_frameworks!
pod 'RxObservableQueue'
Carthage
To integrate RxObservableQueue into your Xcode project using Carthage, specify it in your Cartfile
:
github "notohiro/RxObservableQueue"
Run carthage update
to build the framework and drag the built RxObservableQueue.framework
into your Xcode project.
Usage
Initialize with Observable and the number of concurrency.
queue = RxObservableQueue
.create(observable: someObservable, maxConcurrentCount: 3)
Subscribe and send signal() when you need next object.
queue.subscribe(onNext: { item, counter in
// do some time-consuming task
doSomeOperation(item) {
// send signal() to pop next task from queue
counter.signal()
}
})
.addDisposableTo(bag)
Author
License
RxObservableQueue is available under the MIT license. See the LICENSE file for more info.