{"id":22257671,"url":"https://github.com/shakurocom/taskmanager","last_synced_at":"2025-07-28T07:31:52.383Z","repository":{"id":51082806,"uuid":"350612022","full_name":"shakurocom/TaskManager","owner":"shakurocom","description":"Manager of different background tasks","archived":false,"fork":false,"pushed_at":"2024-10-18T17:01:19.000Z","size":1792,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-19T13:00:28.950Z","etag":null,"topics":["concurrency","gcd","ios","operation","operationqueue","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/shakurocom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-23T07:04:48.000Z","updated_at":"2024-10-18T17:01:07.000Z","dependencies_parsed_at":"2023-02-13T20:45:58.189Z","dependency_job_id":null,"html_url":"https://github.com/shakurocom/TaskManager","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurocom%2FTaskManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurocom%2FTaskManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurocom%2FTaskManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurocom%2FTaskManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakurocom","download_url":"https://codeload.github.com/shakurocom/TaskManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227877846,"owners_count":17833559,"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":["concurrency","gcd","ios","operation","operationqueue","swift"],"created_at":"2024-12-03T08:11:40.429Z","updated_at":"2025-07-28T07:31:52.374Z","avatar_url":"https://github.com/shakurocom.png","language":"Swift","readme":"![Shakuro Task Manager](Resources/title_image.png)\n\u003cbr\u003e\u003cbr\u003e\n# Task Manager\n![Version](https://img.shields.io/badge/version-1.1.6-blue.svg)\n![Platform](https://img.shields.io/badge/platform-iOS-lightgrey.svg)\n![License MIT](https://img.shields.io/badge/license-MIT-green.svg)\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\nTask Manager is a Swift library designed to manage asynchronous operations. The main purpose of the Task Manager component is to encapsulate work with the server, database, and other background operations into unit-like operations or tasks. This helps to separate business logic from UI and reuse operations across the app.\n\n![](Resources/task_manager_concept.png)\n\n## Requirements\n\n- iOS 13.0+\n- Xcode 15.0+\n- Swift 5.0+\n\n## Installation\n\n### CocoaPods\n\nTo integrate Task Manager into your Xcode project with CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'Shakuro.TaskManager'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Manually\n\nIf you prefer not to use CocoaPods, you can integrate Shakuro.TaskManager simply by copying it to your project.\n\n## Usage\n\n1. Create a couple of operations by subclassing `BaseOperation`. An operation should be a complete and independent unit of business logic. \n2. Subclass `TaskManager` and override `.willPerformOperation()`. Define dependencies between operations in this method. It’s a good idea to create two separate `TaskManager` objects/subclasses: one to handle auth-related tasks and the second one for all other work.\n3. Start your tasks by calling `.performOperation()` or `.performGroup()` on `TaskManager`. You can use completions  to handle results.\n\nHave a look at the [TaskManager_Example](https://github.com/shakurocom/TaskManager/tree/master/TaskManager_Example)\n\n### Important notes\n\nAn operation should have `operationHash` defined if its work rely only on its options. Hash is used in `.willPerformOperation()` to construct dependencies.\n\nCarefully consider the dependencies between operations. `.willPerformOperation()` should return an already existing in the queue (old) operation instead of a new one if both operations (old \u0026 new) are equal from the business logic perspective. This will result in only single operation being executed with multiple completion callbacks.\n\nEach task (an operation or a group of operations) can have a `retryHandler` to perform a retry under specified conditions. It is a perfect tool if you are dealing with an unreliable server.\n\nUsual flow: Interactor -\u003e Options -\u003e Task Manager (operations + dependencies inside) -\u003e HTTP Client + Database -\u003e Retry if error (for example session expired error) -\u003e Completion block inside Interactor with typed result.\n\n## License\n\nShakuro.TaskManager is released under the MIT license. [See LICENSE](https://github.com/shakurocom/TaskManager/blob/master/LICENSE.md) for details.\n\n## Give it a try and reach us\n\nExplore our expertise in \u003ca href=\"https://shakuro.com/services/native-mobile-development/?utm_source=github\u0026utm_medium=repository\u0026utm_campaign=task-manager\"\u003eNative Mobile Development\u003c/a\u003e and \u003ca href=\"https://shakuro.com/services/ios-dev/?utm_source=github\u0026utm_medium=repository\u0026utm_campaign=task-manager\"\u003eiOS Development\u003c/a\u003e.\u003c/p\u003e\n\nIf you need professional assistance with your mobile or web project, feel free to \u003ca href=\"https://shakuro.com/get-in-touch/?utm_source=github\u0026utm_medium=repository\u0026utm_campaign=task-manager\"\u003econtact our team\u003c/a\u003e\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakurocom%2Ftaskmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakurocom%2Ftaskmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakurocom%2Ftaskmanager/lists"}