{"id":934,"url":"https://github.com/intelygenz/Kommander-iOS","last_synced_at":"2025-07-30T19:33:09.763Z","repository":{"id":56917998,"uuid":"82901047","full_name":"intelygenz/Kommander-iOS","owner":"intelygenz","description":"A lightweight, pure-Swift library for manage the task execution in different threads. Through the definition a simple but powerful concept, Kommand.","archived":true,"fork":false,"pushed_at":"2019-02-13T18:26:28.000Z","size":1048,"stargazers_count":172,"open_issues_count":1,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-29T07:42:15.261Z","etag":null,"topics":["block","cancel","closure","command","concurrency","current","dispatcher","dispatchqueue","error","execute","execution","kommand","kommander","main","operationqueue","pattern","success","swift","task","thread"],"latest_commit_sha":null,"homepage":"https://intelygenz.github.io/Kommander-iOS/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intelygenz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-23T08:01:57.000Z","updated_at":"2024-01-04T07:57:44.000Z","dependencies_parsed_at":"2022-08-20T21:20:33.351Z","dependency_job_id":null,"html_url":"https://github.com/intelygenz/Kommander-iOS","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelygenz%2FKommander-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelygenz%2FKommander-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelygenz%2FKommander-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intelygenz%2FKommander-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intelygenz","download_url":"https://codeload.github.com/intelygenz/Kommander-iOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228179032,"owners_count":17881126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["block","cancel","closure","command","concurrency","current","dispatcher","dispatchqueue","error","execute","execution","kommand","kommander","main","operationqueue","pattern","success","swift","task","thread"],"created_at":"2024-01-05T20:15:34.966Z","updated_at":"2024-12-04T19:32:25.784Z","avatar_url":"https://github.com/intelygenz.png","language":"Swift","funding_links":[],"categories":["Concurrency","Libs","Concurrency [🔝](#readme)"],"sub_categories":["Linter","Concurrency","Other free courses"],"readme":"![Kommander](https://raw.githubusercontent.com/intelygenz/Kommander-iOS/master/Logo.png)\n\n[![Twitter](https://img.shields.io/badge/contact-@intelygenz-0FABFF.svg?style=flat)](http://twitter.com/intelygenz)\n[![Version](https://img.shields.io/cocoapods/v/Kommander.svg?style=flat)](http://cocoapods.org/pods/Kommander)\n[![License](https://img.shields.io/cocoapods/l/Kommander.svg?style=flat)](http://cocoapods.org/pods/Kommander)\n[![Platform](https://img.shields.io/cocoapods/p/Kommander.svg?style=flat)](http://cocoapods.org/pods/Kommander)\n[![Swift](https://img.shields.io/badge/Swift-4-orange.svg?style=flat)](https://swift.org)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Swift Package Manager Compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager)\n[![Build Status](https://travis-ci.org/intelygenz/Kommander-iOS.svg?branch=master)](https://travis-ci.org/intelygenz/Kommander-iOS)\n[![Documentation](https://img.shields.io/badge/documentation-100%25-brightgreen.svg?style=flat)](https://intelygenz.github.io/Kommander-iOS)\n[![Downloads](https://img.shields.io/cocoapods/dt/Kommander.svg)](http://cocoapods.org/pods/Kommander)\n[![Help Contribute to Open Source](https://www.codetriage.com/intelygenz/kommander-ios/badges/users.svg)](https://www.codetriage.com/intelygenz/kommander-ios)\n\n**Kommander** is a Swift library to manage the task execution in different threads. Through the definition a simple but powerful concept, [**Kommand**](https://en.wikipedia.org/wiki/Command_pattern).\n\nInspired on the Java library [**Kommander**](https://github.com/Wokdsem/Kommander) from [**Wokdsem**](https://github.com/Wokdsem).\n\n\n![Kommander](https://raw.githubusercontent.com/intelygenz/Kommander-iOS/master/Kommander.png)\n\n## 🌟 Features\n\n- [x] Make kommand or multiple kommands\n- [x] Execute kommand or multiple kommands\n- [x] Cancel kommand or multiple kommands\n- [x] Retry kommand or multiple kommands\n- [x] Set kommand success closure\n- [x] Set kommand error closure\n- [x] Set kommand error closure specifying Error type\n- [x] Main thread dispatcher\n- [x] Current thread dispatcher\n- [x] Custom OperationQueue dispatcher\n- [x] Execute single or multiple Operation\n- [x] Execute sequential or concurrent closures\n- [x] Execute DispatchWorkItem\n- [x] Kommand state\n- [x] iOS compatible\n- [x] watchOS compatible\n- [x] tvOS compatible\n- [x] macOS compatible\n- [x] Swift 4 version\n- [x] Swift 3 version\n- [x] Swift 2 version\n- [x] Objective-C version\n\n## 📲 Installation\n\nKommander is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Kommander'\n```\n\nFor Swift 3 compatibility use:\n\n```ruby\npod 'Kommander', '~\u003e 0.7'\n```\n\nFor Swift 2 compatibility use:\n\n```ruby\npod 'Kommander', :git =\u003e 'https://github.com/intelygenz/Kommander-iOS.git', :tag =\u003e '0.3.0-swift2'\n```\n\nFor Objective-C compatibility use:\n\n```ruby\npod 'Kommander', :git =\u003e 'https://github.com/intelygenz/Kommander-iOS.git', :tag =\u003e '0.2.3-objc'\n```\n\n#### Or you can install it with [Carthage](https://github.com/Carthage/Carthage):\n\n```ogdl\ngithub \"intelygenz/Kommander-iOS\"\n```\n\n#### Or install it with [Swift Package Manager](https://swift.org/package-manager/):\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/intelygenz/Kommander-iOS.git\")\n]\n```\n\n## 🐒 Usage\n\n#### Making, executing, cancelling and retrying Kommands:\n\n```swift\nKommander().make {\n    // Your code here\n}.execute()\n```\n\n```swift\nKommander().make {\n    // Your code here\n}.execute(after: .seconds(2))\n```\n\n```swift\nKommander().make {\n    return \"Your string\"\n}.success { yourString in\n    print(yourString)\n}.execute()\n```\n\n```swift\nKommander().make {\n    throw CocoaError(.featureUnsupported)\n}.error { error in\n    print(String(describing: error!))\n}.execute()\n```\n\n##### Specify Error type:\n\n```swift\nKommander().make {\n    throw MyError.error\n}.error(MyError.self) { error in\n    // error is MyError type.\n}.execute()\n```\n\n##### Retry after cancellation:\n\n```swift\nlet kommand = Kommander().make { () -\u003e Any? in\n    // Your code here\n}.success { result in\n    // Your success handling here\n}.error { error in\n    // Your error handling here\n}.execute()\n\nkommand.cancel()\n\nkommand.retry()\n```\n\n##### Retry after failure:\n\n```swift\nlet kommand = Kommander().make { () -\u003e Any? in\n    // Your code here\n}.error { error in\n    // Your error handling here\n}.retry { error, executionCount in\n    return executionCount \u003c 2\n}.execute()\n```\n\n#### Creating Kommanders:\n\n```swift\nKommander(deliverer: Dispatcher = .current, executor: Dispatcher = .default)\n\nKommander(deliverer: Dispatcher = .current, name: String, qos: QualityOfService = .default, maxConcurrentOperations: Int = .default)\n```\n\n##### Shortcuts:\n\n```swift\nKommander.main\n\nKommander.current\n\nKommander.default\n\nKommander.userInteractive\n\nKommander.userInitiated\n\nKommander.utility\n\nKommander.background\n```\n\n#### Creating Dispatchers:\n\n```swift\nCurrentDispatcher()\n\nMainDispatcher()\n\nDispatcher(name: String, qos: QualityOfService = .default, maxConcurrentOperations: Int = .default)\n```\n\n##### Shortcuts:\n\n```swift\nDispatcher.main\n\nDispatcher.current\n\nDispatcher.default\n\nDispatcher.userInteractive\n\nDispatcher.userInitiated\n\nDispatcher.utility\n\nDispatcher.background\n```\n\n## ❤️ Etc.\n\n* Contributions are very welcome.\n* Attribution is appreciated (let's spread the word!), but not mandatory.\n\n## 👨‍💻 Authors\n\n[alexruperez](https://github.com/alexruperez), alejandro.ruperez@intelygenz.com\n\n[juantrias](https://github.com/juantrias), juan.trias@intelygenz.com\n\n[RobertoEstrada](https://github.com/RobertoEstrada), roberto.estrada@intelygenz.com\n\n## 👮‍♂️ License\n\nKommander is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelygenz%2FKommander-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintelygenz%2FKommander-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelygenz%2FKommander-iOS/lists"}