{"id":17225434,"url":"https://github.com/rommansabbir/taskx","last_synced_at":"2025-03-25T17:23:13.934Z","repository":{"id":112646734,"uuid":"484399956","full_name":"rommansabbir/TaskX","owner":"rommansabbir","description":"Execute a list of given body (as a Task) and return a list of Result (Success or Error)","archived":false,"fork":false,"pushed_at":"2022-04-22T11:08:06.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T15:16:49.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rommansabbir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-04-22T10:58:38.000Z","updated_at":"2022-04-22T11:01:48.000Z","dependencies_parsed_at":"2023-06-10T10:45:29.459Z","dependency_job_id":null,"html_url":"https://github.com/rommansabbir/TaskX","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FTaskX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FTaskX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FTaskX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FTaskX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rommansabbir","download_url":"https://codeload.github.com/rommansabbir/TaskX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245507876,"owners_count":20626686,"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":[],"created_at":"2024-10-15T04:13:31.954Z","updated_at":"2025-03-25T17:23:13.826Z","avatar_url":"https://github.com/rommansabbir.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release](https://jitpack.io/v/jitpack/android-example.svg)](https://jitpack.io/#rommansabbir/TaskX)\n\n# TaskX\n\nExecute a list of given body (as a Task) and return a list of Result (Success or Error)\n\n---\n\n## Documentation\n\n### Installation\n\nStep 1. Add the JitPack repository to your build file .\n\n```gradle\n    allprojects {\n        repositories {\n            maven { url 'https://jitpack.io' }\n        }\n    }\n```\n\nStep 2. Add the dependency.\n\n```gradle\n    dependencies {\n            implementation 'com.github.rommansabbir:TaskX:Tag'\n    }\n```\n\n---\n\n### Version available\n\n| Releases\n| ------------- |\n| 1.0.0         |\n\n\n# Usages\n\n## Why TaskX?\n- To execute a list of body (as a Task) in a linear way\n- To get Results (Success or Error) of the Tasks\n\n## Example?\n```\nclass TaskXTest {\n    class TestClass(val data: String)\n\n    @Test\n    fun checkTaskXExecution() {\n        val result = executeTaskX(\n            mutableListOf(\n                //First task, return an instance of TestClass\n                TaskXBody { TestClass(\"Hello\") },\n                //Second task, throw an Exception\n                TaskXBody { throw Exception(\"test\") },\n                //Third task, return a String\n                TaskXBody { \"Hello\" },\n            )\n        )\n        //First task should be Success and data is 'Hello'\n        val firstResult = result[0]\n        assert(!firstResult.isError())\n        assert((firstResult.getSuccess().data as TestClass).data == \"Hello\")\n\n        //Second task should be Error, an Instance of Exception and message is 'test'\n        val secondResult = result[1]\n        assert(secondResult.isError())\n        assert(secondResult.getError().exception is Exception)\n        assert(secondResult.getError().exception.message == \"test\")\n\n        //Third task should be Success and data is 'Hello'\n        val thirdResult = result[2]\n        assert(!thirdResult.isError())\n        assert(thirdResult.getSuccess().data == \"Hello\")\n    }\n}\n```\n----\n### Happy Coding....\n\n---\n\n### Contact me\n\n[LinkedIn](https://www.linkedin.com/in/rommansabbir/) | [Blog](https://rommansabbir.com/)\n\n---\n\n### License\n\n[Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n````html\nCopyright (C) 2022 Romman Sabbir\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frommansabbir%2Ftaskx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frommansabbir%2Ftaskx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frommansabbir%2Ftaskx/lists"}