{"id":1158,"url":"https://github.com/Albinzr/SwiftyTask","last_synced_at":"2025-07-30T20:32:42.473Z","repository":{"id":62457023,"uuid":"80753643","full_name":"Albinzr/SwiftyTask","owner":"Albinzr","description":"An extreme queuing system with high performance for managing all task in app with closure","archived":false,"fork":false,"pushed_at":"2018-04-22T18:00:07.000Z","size":19,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-20T19:02:40.110Z","etag":null,"topics":["backgroundqueue","dispatchqueue","swift","swifty"],"latest_commit_sha":null,"homepage":null,"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/Albinzr.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-02-02T18:11:04.000Z","updated_at":"2023-12-01T04:48:42.000Z","dependencies_parsed_at":"2022-11-02T00:17:00.063Z","dependency_job_id":null,"html_url":"https://github.com/Albinzr/SwiftyTask","commit_stats":null,"previous_names":["cr-creations/swiftytask"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albinzr%2FSwiftyTask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albinzr%2FSwiftyTask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albinzr%2FSwiftyTask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albinzr%2FSwiftyTask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Albinzr","download_url":"https://codeload.github.com/Albinzr/SwiftyTask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228187551,"owners_count":17882324,"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":["backgroundqueue","dispatchqueue","swift","swifty"],"created_at":"2024-01-05T20:15:40.178Z","updated_at":"2024-12-04T20:31:03.525Z","avatar_url":"https://github.com/Albinzr.png","language":"Swift","funding_links":[],"categories":["GCD"],"sub_categories":["Getting Started","Other free courses","Linter"],"readme":"# SwiftyTask\nAn extreme queuing system with high performance for managing all task in app with closure\n\n# Task\n\n[![Swift 3.0](https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![Platforms iOS](https://img.shields.io/badge/Platforms-iOS-lightgray.svg?style=flat)](https://developer.apple.com/swift/)\n[![Xcode 8.0](https://img.shields.io/badge/Xcode-8.0-blue.svg?style=flat)](https://developer.apple.com/swift/)\n[![Gemnasium](https://img.shields.io/gemnasium/mathiasbynens/he.svg)]()\n[![Ratting](https://img.shields.io/amo/rating/dustman.svg)]()\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()\n\n\nMethod Tasking of queued closure on GCD (Grand Central Dispatch).\n\n## Requirements\n\n* iOS 10.0+\n* Swift 4.1+\n* Xcode 9.2+\n\n## Installation\n\n### CocoaPods\n\nTask is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\nuse_frameworks!\n\npod \"SwiftyTask\"\n```\n\nor\n\n```ruby\nuse_frameworks!\n\npod 'SwiftyTask', git: 'https://github.com/Albinzr/SwiftyTask', :tag =\u003e '1.0.1'\n\n```\n\n### Carthage\n\nTo integrate Task into your Xcode project using Carthage, specify it in your Cartfile:\n\n```ruby\ngithub \"CR-Creations/SwiftyTask\"\n```\n\n## Example\n\n\n### Basics\n\n```swift\nSwiftyTask.main {\n\n    // main thread queue\n\n    return \"1\"\n    }.background { result in\n\n         // background qos class thread queue\n         print(result) \n\n         return \"2\"\n    }.userInteractive { result in\n\n         // userInteractive qos class thread queue\n         print(result) \n\n         return \"3\"\n    }.userInitiated { result in\n         //userInitiated qos class thread queue\n         print(result) \n\n         return \"4\"\n    }.onDefault { result in\n         // default qos class thread queue\n\n         print(result)\n         return \"5\"\n    }.run(.Main) { result in\n\n         // called at main thread queue\n         print(result) \n         print(\"Process completion\")\n}\n```\n\n### Custom queue\n\n```swift\nlet queue = dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0)\n\nSwiftyTask.custom(queue) {\n    \n    //customQueue\n\n    return nil\n    }.onDefault { result in\n\n         //default qos class thread queue\n\n         return result\n    }.main { result in\n\n         //main thread queue\n\n         return result\n    }.custom(customQueue) { result in\n         \n         // customQueue\n         \n         return result\n    }.run()\n```\n\n### After\n\n```swift\nSwiftyTask.main {\n    \n    // main thread queue\n\n    print(\"start after: \\(Date().description)\")\n\n    return \"1\"\n    }.after(seconds: 5) { result in\n\n        // 5 seconds after the previous block\n        //background qos class thread queue\n\n        print(result)\n        return \"after 2: \\(Date().description)\"\n    }.userInteractive { result in\n\n        //userInteractive qos class thread queue\n\n        print(result)\n        return \"after 3: \\(Date().description)\"\n    }.after(Queue.Utility, seconds: 5) { result in\n\n        //5 seconds after the previous block\n        // called at utility qos class thread queue\n\n        print(result) \n        return \"after 4: \\(Date().description)\"\n    }.run(.Main) { result in\n\n        // last call main thread queue\n\n        print(result) \n        print(\"after completion: \\(Date().description)\")\n}\n```\n\n### Wait\n\n```swift\nSwiftyTask.main {\n\n    //  main thread queue\n\n    print(\"start wait: \\(Date().description)\")\n    return \"1\"\n    }.wait(seconds: 5).background { result in\n\n        // 5 seconds after the previous block\n        // background qos class thread queue\n\n        print(\"wait 2: \\(Date().description)\")\n        return result\n    }.wait(seconds: 5).main { result in\n\n        // 5 seconds after the previous block\n        // main thread queue\n\n        print(\"wait 3: \\(Date().description)\")\n        return result\n    }.run()\n\n\n```\n\n\n\n## License\n\nMIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlbinzr%2FSwiftyTask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlbinzr%2FSwiftyTask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlbinzr%2FSwiftyTask/lists"}