CocoaPods trunk is moving to be read-only. Read more on theblog, there are 14 months to go.
| TestsTested | ✓ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Sep 2018 |
| SPMSupports SPM | ✓ |
Maintained byalexruperez.
Kommander is a Swift library to manage the task execution in different threads. Through the definition a simple but powerful concept,Kommand.
Inspired on the Java libraryKommander fromWokdsem.
Kommander is available throughCocoaPods. To installit, simply add the following line to your Podfile:
pod'Kommander'For Swift 3 compatibility use:
pod'Kommander','~> 0.7'
For Swift 2 compatibility use:
pod'Kommander',:git =>'https://github.com/intelygenz/Kommander-iOS.git',:tag =>'0.3.0-swift2'
For Objective-C compatibility use:
pod'Kommander',:git =>'https://github.com/intelygenz/Kommander-iOS.git',:tag =>'0.2.3-objc'
github "intelygenz/Kommander-iOS"dependencies: [ .package(url:"https://github.com/intelygenz/Kommander-iOS.git")]
Kommander().make {// Your code here}.execute()
Kommander().make {// Your code here}.execute(after: .seconds(2))
Kommander().make {return"Your string"}.success { yourStringinprint(yourString)}.execute()
Kommander().make {throwCocoaError(.featureUnsupported)}.error { errorinprint(String(describing: error!))}.execute()
Kommander().make {throw MyError.error}.error(MyError.self) { errorin// error is MyError type.}.execute()
let kommand=Kommander().make { ()->Any?in// Your code here}.success { resultin// Your success handling here}.error { errorin// Your error handling here}.execute()kommand.cancel()kommand.retry()
let kommand=Kommander().make { ()->Any?in// Your code here}.error { errorin// Your error handling here}.retry { error, executionCountinreturn executionCount<2}.execute()
Kommander(deliverer: Dispatcher= .current,executor: Dispatcher= .default)Kommander(deliverer: Dispatcher= .current,name:String,qos: QualityOfService= .default,maxConcurrentOperations:Int= .default)
Kommander.mainKommander.currentKommander.defaultKommander.userInteractiveKommander.userInitiatedKommander.utilityKommander.background
CurrentDispatcher()MainDispatcher()Dispatcher(name:String,qos: QualityOfService= .default,maxConcurrentOperations:Int= .default)
Dispatcher.mainDispatcher.currentDispatcher.defaultDispatcher.userInteractiveDispatcher.userInitiatedDispatcher.utilityDispatcher.background
RobertoEstrada,[email protected]
Kommander is available under the MIT license. See the LICENSE file for more info.