{"id":21176984,"url":"https://github.com/scalio/command-based-architecture","last_synced_at":"2025-07-09T21:32:29.381Z","repository":{"id":49984515,"uuid":"249327477","full_name":"scalio/command-based-architecture","owner":"scalio","description":"Android Command Based Architecture for simple synchronization logic","archived":false,"fork":false,"pushed_at":"2023-10-05T22:17:41.000Z","size":1644,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T07:51:13.913Z","etag":null,"topics":["android","android-command","architecture","commandmanager","kotlin-android"],"latest_commit_sha":null,"homepage":"","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/scalio.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}},"created_at":"2020-03-23T03:31:45.000Z","updated_at":"2022-05-15T15:14:31.000Z","dependencies_parsed_at":"2022-08-03T15:45:15.831Z","dependency_job_id":null,"html_url":"https://github.com/scalio/command-based-architecture","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/scalio/command-based-architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalio%2Fcommand-based-architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalio%2Fcommand-based-architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalio%2Fcommand-based-architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalio%2Fcommand-based-architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalio","download_url":"https://codeload.github.com/scalio/command-based-architecture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalio%2Fcommand-based-architecture/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264503951,"owners_count":23618762,"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":["android","android-command","architecture","commandmanager","kotlin-android"],"created_at":"2024-11-20T17:14:09.541Z","updated_at":"2025-07-09T21:32:28.998Z","avatar_url":"https://github.com/scalio.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Command Based Architecture](https://raw.githubusercontent.com/scalio/command-based-architecture/master/scalio-cba.svg?sanitize=true)\n\n\u003ch1 align=\"center\"\u003eCommand Based Architecture for Android\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Process concurrent tasks on data sources\n\u003c/p\u003e\n\n\u0026nbsp;\n\n## Features\n\nThis is an Android Command Based Architecture for processing concurrent tasks (commands) on single or multiple data sources. This library supports the execution and synchronization of different tasks on multiple threads.\n\nKey features in flow control:\n1. Ability to control if a task should be executed or skipped based on current data (screen) state.\n2. Ability to control if a task should be executed immediately or delayed based on current data (screen) state.\n3. Ability to block/postpone other tasks during task execution.\n\nKey features in data change:\nEach task has its own lifecycle:\n1. After command was added to the queue - `onCommandWasAdded`\n2. Immediately before command execution - `onExecuteStarting`\n3. Immediately after successful execution - `onExecuteSuccess`\n4. Immediately after failed execution - `onExecuteFail`\n5. Final step of execution (called on any success or fail) - `onExecuteFinished`\n\n## Integration with Gradle\n\nFor coroutine implementation:\n```\n    implementation 'io.scal:commandbasedarchitecture_coroutine:version'\n```\n\nPlease replace `version` with the latest version: \u003ca href=\"https://maven-badges.herokuapp.com/maven-central/io.scal/commandbasedarchitecture_coroutine\"\u003e\u003cimg src=\"https://maven-badges.herokuapp.com/maven-central/io.scal/commandbasedarchitecture_coroutine/badge.svg\" /\u003e\u003c/a\u003e\n\n\nFor RxJava implementation:\n```\n    implementation 'io.scal:commandbasedarchitecture_rxjava:version'\n```\n\nPlease replace `version` with the latest version: \u003ca href=\"https://maven-badges.herokuapp.com/maven-central/io.scal/commandbasedarchitecture_rxjava\"\u003e\u003cimg src=\"https://maven-badges.herokuapp.com/maven-central/io.scal/commandbasedarchitecture_rxjava/badge.svg\" /\u003e\u003c/a\u003e\n\n\n## How to use\n\nPlease find the full description in [the post](https://scal.io/blog/command-based-architecture).\n\nBasic Setup:\n1. Create an instance of CommandManager: `val commandManager: CommandManager\u003cScreenState\u003e by lazy { CommandManagerImpl(mutableScreenState, viewModelScope) }`\n2. Use an existing or create a custom command (RefreshCommand, LoadNextCommand).\n    a. Implement execution strategy directly in the command (ExecutionStrategy class)\n    b. Implement data side effects during command lifecycle\n3. Add command to execution queue by calling `commandManager.postCommand(yourCommand)`\n\nBy default, the CommandManager uses `Dispatchers.Main` for execution, so you will need to switch to an appropriate Dispatcher if you require more complex logic.\n\n\n## Customizations\n\nTBD\n\n\n## Example\n\n![Example](https://raw.githubusercontent.com/scalio/command-based-architecture/master/resources/list_details_broadcast.gif)\n\n#### Contact ####\n\nFeel free to reach out to me.\n\n    Website:    https://scal.io\n    LinkedIn:   https://www.linkedin.com/company/scalio/\n    LinkedIn:   https://www.linkedin.com/in/mig35/\n    Email:      mikhail@scal.io\n    Email:      mig35@mig35.com\n\n#### License ####\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n    \n## About us\n\n\u003cp align=\"center\"\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://scal.io/\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/scalio/bazel-status/master/assets/scalio-logo.svg?sanitize=true\" /\u003e\n    \u003c/a\u003e\n    \u003cbr/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalio%2Fcommand-based-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalio%2Fcommand-based-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalio%2Fcommand-based-architecture/lists"}