Kommander alternatives and similar libraries
Based on the "Concurrency" category.
Alternatively, view Kommander alternatives based on common mentions on social networks and blogs.
-
Hydra
โก๏ธ Lightweight full-featured Promises, Async & Await Library in Swift -
Venice
Coroutines, structured concurrency and CSP for Swift on macOS and Linux. -
Overdrive
Fast async task based API in Swift with focus on type safety, concurrency and multi threading. -
AsyncNinja
A complete set of primitives for concurrency and reactive programming on Swift -
Throttler
Throttler is a library helping you debounce and throttle without having to go to reactive (RxSwift, Combine) -
Futura
Asynchronous Swift made easy. The project was made by Miquido. https://www.miquido.com/ -
Solver7CSP
CSP like thread management with Swift. I became interested in Swift when I saw that it is becoming compatible with TensorFlow. I reworked an old Java project of mine from 1998 in order to learn how to do some things in Swift.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Kommander or a related project?
README
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 library Kommander from Wokdsem.
๐ Features
- [x] Make kommand or multiple kommands
- [x] Execute kommand or multiple kommands
- [x] Cancel kommand or multiple kommands
- [x] Retry kommand or multiple kommands
- [x] Set kommand success closure
- [x] Set kommand error closure
- [x] Set kommand error closure specifying Error type
- [x] Main thread dispatcher
- [x] Current thread dispatcher
- [x] Custom OperationQueue dispatcher
- [x] Execute single or multiple Operation
- [x] Execute sequential or concurrent closures
- [x] Execute DispatchWorkItem
- [x] Kommand state
- [x] iOS compatible
- [x] watchOS compatible
- [x] tvOS compatible
- [x] macOS compatible
- [x] Swift 4 version
- [x] Swift 3 version
- [x] Swift 2 version
- [x] Objective-C version
๐ฒ Installation
Kommander is available through CocoaPods. To install it, 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'
Or you can install it with Carthage:
github "intelygenz/Kommander-iOS"
Or install it with Swift Package Manager:
dependencies: [
.package(url: "https://github.com/intelygenz/Kommander-iOS.git")
]
๐ Usage
Making, executing, cancelling and retrying Kommands:
Kommander().make {
// Your code here
}.execute()
Kommander().make {
// Your code here
}.execute(after: .seconds(2))
Kommander().make {
return "Your string"
}.success { yourString in
print(yourString)
}.execute()
Kommander().make {
throw CocoaError(.featureUnsupported)
}.error { error in
print(String(describing: error!))
}.execute()
Specify Error type:
Kommander().make {
throw MyError.error
}.error(MyError.self) { error in
// error is MyError type.
}.execute()
Retry after cancellation:
let kommand = Kommander().make { () -> Any? in
// Your code here
}.success { result in
// Your success handling here
}.error { error in
// Your error handling here
}.execute()
kommand.cancel()
kommand.retry()
Retry after failure:
let kommand = Kommander().make { () -> Any? in
// Your code here
}.error { error in
// Your error handling here
}.retry { error, executionCount in
return executionCount < 2
}.execute()
Creating Kommanders:
Kommander(deliverer: Dispatcher = .current, executor: Dispatcher = .default)
Kommander(deliverer: Dispatcher = .current, name: String, qos: QualityOfService = .default, maxConcurrentOperations: Int = .default)
Shortcuts:
Kommander.main
Kommander.current
Kommander.default
Kommander.userInteractive
Kommander.userInitiated
Kommander.utility
Kommander.background
Creating Dispatchers:
CurrentDispatcher()
MainDispatcher()
Dispatcher(name: String, qos: QualityOfService = .default, maxConcurrentOperations: Int = .default)
Shortcuts:
Dispatcher.main
Dispatcher.current
Dispatcher.default
Dispatcher.userInteractive
Dispatcher.userInitiated
Dispatcher.utility
Dispatcher.background
โค๏ธ Etc.
- Contributions are very welcome.
- Attribution is appreciated (let's spread the word!), but not mandatory.
๐จโ๐ป Authors
alexruperez, [email protected]
RobertoEstrada, [email protected]
๐ฎโโ๏ธ License
Kommander is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the Kommander README section above
are relevant to that project's source code only.