intelygenz / Kommander Ios
Licence: mit
A lightweight, pure-Swift library for manage the task execution in different threads. Through the definition a simple but powerful concept, Kommand.
Stars: ✭ 167
Programming Languages
swift
15916 projects
Projects that are alternatives of or similar to Kommander Ios
ComposableAsync
Create, compose and inject asynchronous behaviors in .Net Framework and .Net Core.
Stars: ✭ 28 (-83.23%)
Mutual labels: task, thread, concurrency
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (+15.57%)
Mutual labels: task, thread, concurrency
Concurrent Programming
🌵《实战java高并发程序设计》源码整理
Stars: ✭ 562 (+236.53%)
Mutual labels: concurrency, thread
Readline Sync
Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).
Stars: ✭ 601 (+259.88%)
Mutual labels: command, block
Lightio
LightIO is a userland implemented green thread library for ruby
Stars: ✭ 165 (-1.2%)
Mutual labels: concurrency, thread
Java Concurrent Programming
📓 《实战Java 高并发程序设计》笔记和源码整理
Stars: ✭ 162 (-2.99%)
Mutual labels: concurrency, thread
Hamsters.js
100% Vanilla Javascript Multithreading & Parallel Execution Library
Stars: ✭ 517 (+209.58%)
Mutual labels: concurrency, thread
Taskmanager
A simple、 light(only two file)、fast 、powerful 、easy to use 、easy to extend 、 Android Library To Manager your AsyncTask/Thread/CallBack Jobqueue ! 一个超级简单,易用,轻量级,快速的异步任务管理器,类似于AsyncTask,但是比AsyncTask更好用,更易控制,从此不再写Thread ! ^_^
Stars: ✭ 25 (-85.03%)
Mutual labels: task, thread
concurrency-kit
🚄 Concurrency abstractions framework for Apple Platforms [Task, Atomic, Lock, Operation, etc.].
Stars: ✭ 17 (-89.82%)
Mutual labels: task, concurrency
Rpmalloc
Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C
Stars: ✭ 1,218 (+629.34%)
Mutual labels: concurrency, thread
Threadly
Type-safe thread-local storage in Swift
Stars: ✭ 58 (-65.27%)
Mutual labels: concurrency, thread
Shellkit
Objective-C framework for running shell scripts.
Stars: ✭ 83 (-50.3%)
Mutual labels: command, task
Concurrency
Java 并发编程知识梳理以及常见处理模式 features and patterns
Stars: ✭ 495 (+196.41%)
Mutual labels: concurrency, thread
React Native Threads
Create new JS processes for CPU intensive work
Stars: ✭ 527 (+215.57%)
Mutual labels: concurrency, thread
allot
Parse placeholder and wildcard text commands
Stars: ✭ 51 (-69.46%)
Mutual labels: command, pattern
Mt
tlock, RWMUTEX, Collab, USM, RSem and other C++ templates for Windows to provide read/write mutex locks, various multithreading tools, collaboration, differential updates and more
Stars: ✭ 18 (-89.22%)
Mutual labels: concurrency, thread
Unitask
Provides an efficient allocation free async/await integration for Unity.
Stars: ✭ 2,547 (+1425.15%)
Mutual labels: task, thread
context-propagation
Propagate snapshots of ThreadLocal values to another thread
Stars: ✭ 15 (-91.02%)
Mutual labels: thread, concurrency
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'
Carthage:
Or you can install it withgithub "intelygenz/Kommander-iOS"
Swift Package Manager:
Or install it withdependencies: [
.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 the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].