{"id":19338527,"url":"https://github.com/jvk75/parallelswift","last_synced_at":"2025-02-24T08:17:04.788Z","repository":{"id":56921367,"uuid":"119441639","full_name":"jvk75/ParallelSwift","owner":"jvk75","description":"Simple parallel function executer","archived":false,"fork":false,"pushed_at":"2020-10-09T14:27:48.000Z","size":190,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T20:16:03.928Z","etag":null,"topics":["ios","parallel","parallel-processing","swift"],"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/jvk75.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":"2018-01-29T21:05:18.000Z","updated_at":"2022-11-28T13:19:31.000Z","dependencies_parsed_at":"2022-08-20T21:50:28.245Z","dependency_job_id":null,"html_url":"https://github.com/jvk75/ParallelSwift","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FParallelSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FParallelSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FParallelSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvk75%2FParallelSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvk75","download_url":"https://codeload.github.com/jvk75/ParallelSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240441953,"owners_count":19801793,"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":["ios","parallel","parallel-processing","swift"],"created_at":"2024-11-10T03:17:46.293Z","updated_at":"2025-02-24T08:17:04.715Z","avatar_url":"https://github.com/jvk75.png","language":"Swift","readme":"# ParallelSwift\n\nWrapper to simplify parallel execution of methods. With three different excution modes. \nPlus optional timeout to prevent locking app, and possibility to shuffle queue order.\nMade purely in Swift. See Test folder for usege examples.\n\n## Install\nParallelSwift is available through [CocoaPods](http://cocoapods.org). and via Swift Package Manager.\n\n### Cocoapods\n\nTo install it, simply add the following line to your Podfile:\n\n```\npod 'ParallelSwift'\n```\n\n### Swift Package Manager\n\nAdd link to this repository in Xcode to projects Swift Packages. \n```https://github.com/jvk75/ParallelSwift```\n\n### Manually\n\nAdd Sources folder to your project\n\n\n## Modes\n### All\nExecution closure is executed after all phase closures are finnished.\n\n ![all](https://github.com/jvk75/ParallelSwift/raw/master/img/all.png \"all\")\n\n### Any\nExecution closure is executed after first phase closure is finnished.\n\n![any](https://github.com/jvk75/ParallelSwift/raw/master/img/any.png \"any\")\n\n### None\nExecution closure is executed immediately after phases are started.\n\n![none](https://github.com/jvk75/ParallelSwift/raw/master/img/none.png \"none\")\n\n\n## Usage \n\nAdd methods to be executed as  closure with ```addPhase``` (one by one) or with ```addPhases``` (as array).\nBoth methods take one parameter that defines where the phase/s are executed (.main or .background (default)) \nOnce excute is called all phases are launch simultaneusly (in parallel). \n\nMethods will mark themself finnished a by calling input closure (e.g. ```done``` in the example) .\n\nExecution completion closure is always executed in main thread. See modes.\n\n```\n    let p = ParallelSwift()\n\n    p.addPhase { done in\n       print(\"1\")\n       done()\n    }\n    p.addPhase { done in\n       print(\"2\")\n       done()\n    }\n    p.addPhase(.main) { done in\n        print(\"3\")\n        done()\n    }\n    p.execute(.all) {\n        print(\"all done\")\n    }\n```\n\nSee tests for more use cases.\n\n### Parameters\n\n```timeout``` : Time in seconds after which execute completion is called even if phases are still running. *Default: 0 (no timeout)*\n\n```shufflePhases```: If true the order which phases are put to operation queue is randomized. *Default: false*\n\n## Issues and contribution\n\nIf you find any issues please open an issue to this repository.\n\nImprovements and/or fixes as pull requests are more than welcome.\n\n## Author\n\nJari Kalinainen, jari(a)klubitii.com\n\n## License\n\nParallelSwift is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvk75%2Fparallelswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvk75%2Fparallelswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvk75%2Fparallelswift/lists"}