{"id":939,"url":"https://github.com/quanvo87/GroupWork","last_synced_at":"2025-08-06T13:32:05.682Z","repository":{"id":56913020,"uuid":"114701333","full_name":"quanvo87/GroupWork","owner":"quanvo87","description":"Easy, concurrent, asynchronous tasks in Swift.","archived":false,"fork":false,"pushed_at":"2018-02-22T16:05:01.000Z","size":274,"stargazers_count":42,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-28T11:42:51.266Z","etag":null,"topics":["asynchronous","concurrency","dispatch","dispatch-group","swift"],"latest_commit_sha":null,"homepage":"","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/quanvo87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-19T00:30:08.000Z","updated_at":"2024-03-30T14:12:02.000Z","dependencies_parsed_at":"2022-08-21T03:20:27.270Z","dependency_job_id":null,"html_url":"https://github.com/quanvo87/GroupWork","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quanvo87%2FGroupWork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quanvo87%2FGroupWork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quanvo87%2FGroupWork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quanvo87%2FGroupWork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quanvo87","download_url":"https://codeload.github.com/quanvo87/GroupWork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905449,"owners_count":17989770,"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":["asynchronous","concurrency","dispatch","dispatch-group","swift"],"created_at":"2024-01-05T20:15:35.071Z","updated_at":"2024-12-09T14:30:45.478Z","avatar_url":"https://github.com/quanvo87.png","language":"Swift","funding_links":[],"categories":["Concurrency","Libs","Architecture and State","Concurrency [🔝](#readme)"],"sub_categories":["Linter","Concurrency","Other free courses"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"Assets/banner.jpg\" title=\"GroupWork\"\u003e\n\u003c/p\u003e\n\n![iOS](https://img.shields.io/badge/os-iOS-green.svg?style=flat)\n![Linux](https://img.shields.io/badge/os-linux-green.svg?style=flat)\n[![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg)](https://swift.org)\n[![CocoaPods Version Status](https://img.shields.io/cocoapods/v/GroupWork.svg)](https://cocoapods.org/pods/GroupWork)\n[![CocoaPods](https://img.shields.io/cocoapods/dt/GroupWork.svg)](https://cocoapods.org/pods/GroupWork)\n[![CocoaPods](https://img.shields.io/cocoapods/dm/GroupWork.svg)](https://cocoapods.org/pods/GroupWork)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Build Status](https://travis-ci.org/quanvo87/GroupWork.svg?branch=master)](https://travis-ci.org/quanvo87/GroupWork)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n\nGroupWork is an easy to use Swift framework that helps you orchestrate your concurrent, asynchronous functions in a clean and organized way. This helps make large functions with multiple asynchronous tasks more clear and easy to follow.\n\n## Contents\n\n1. [Requirements](#requirements)\n2. [Installation](#installation)\n    - [CocoaPods](#cocoapods)\n    - [Carthage](#carthage)\n    - [Swift Package Manager](#swift-package-manager)\n    - [Manually](#manually)\n3. [Documentation](#documentation)\n4. [Example Usage](#example-usage)\n5. [Working Example](#working-example)\n6. [License](#license)\n7. [Authors](#authors)\n\n## Requirements\n\n[Swift 4](https://swift.org/)\n\n## Installation\n\n#### CocoaPods\n\nFor [CocoaPods](http://cocoapods.org/), add to `Podfile`:\n\n```ruby\npod 'GroupWork', '~\u003e 0.0'\n```\n\n#### Carthage\nFor [Carthage](https://github.com/Carthage/Carthage), add to `Cartfile`:\n\n```\ngithub \"quanvo87/GroupWork\"\n```\n\n#### Swift Package Manager\n\nFor [SPM](https://swift.org/package-manager/), add to your package dependencies:\n\n```\n.package(url: \"https://github.com/quanvo87/GroupWork.git\", .upToNextMinor(from: \"0.0.0\"))\n```\n\n#### Manually\n\n- for projects, drag `GroupWork.swift` to the project tree\n- for workspaces, include the whole `GroupWork.xcodeproj`\n\n## Documentation\n\n[Here](https://quanvo87.github.io/GroupWork/)\n\n## Example Usage\n\n#### End Goal\n\n```swift\nimport GroupWork\n\n...\n\nfunc complexFunc(completion: @escaping (Bool) -\u003e Void) {\n  let work = GroupWork()\n\n  work.asyncFuncA()\n  work.asyncFuncB()\n  work.asyncFuncC()\n\n  work.allDone() {\n    completion(work.result)\n  }\n}\n\n...\n```\n\n`complexFunc` is a function that returns the result of three asynchronous functions `asyncFuncA()`, `asyncFuncB()`, and `asyncFuncC()`, running concurrently. The completion handler is called only when all these functions have completed. Usage of this library has enabled the above clean interface. This can be scaled to much higher than three asynchronous functions.\n\nnotes:\n  - the asynchronous functions should be able to run concurrently without affecting each other\n  - `work.result` is only a simple `Bool`\n  - this is not an answer to [callback hell](http://callbackhell.com/)\n\n#### Set Up\n\nThere is some set up required in order to create `complexFunc()` from above:\n\n```swift\nimport GroupWork\n\nextension GroupWork {\n  func asyncFuncA() {\n    start()\n    networkCallA() { (result) in\n      self.finish(withResult: result)\n    }\n  }\n\n  func asyncFuncB() {\n    start()\n    networkCallB() { (result) in\n      self.finish(withResult: result)\n    }\n  }\n\n  func asyncFuncC() {\n    start()\n    networkCallC() { (result) in\n      self.finish(withResult: result)\n    }\n  }\n}\n```\n\nNow you can create a `GroupWork`, and call `work.simpleFuncA()` on it like in the example.\n\nnotes:\n  - `start()` must be called before an asynchronous task\n  - `finish()` must be called in the completion handler of an asynchronous task\n  - `start()` and `finish()` calls must be balanced\n\n## Working Example\n\nThe [tests](Tests/GroupWorkTests/GroupWorkTests.swift) have a working example.\n\n## License\n[MIT](http://opensource.org/licenses/MIT) [LICENSE](LICENSE)\n\n## Authors\n\n- [Quan Vo](https://github.com/quanvo87)\n- [Wilson Ding](https://github.com/dingwilson)\n- Banner: [Michelle Law](http://dropr.com/mlaw)\n\n*Please provide attribution, it is greatly appreciated.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquanvo87%2FGroupWork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquanvo87%2FGroupWork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquanvo87%2FGroupWork/lists"}