{"id":26736760,"url":"https://github.com/iashraful/async-coro-runner","last_synced_at":"2026-03-09T13:36:57.575Z","repository":{"id":257857541,"uuid":"872953853","full_name":"iashraful/async-coro-runner","owner":"iashraful","description":"The AsyncIO Task Runner (Coro Runner) is a Python utility designed for managing concurrent asynchronous tasks using the built-in asyncio module.","archived":false,"fork":false,"pushed_at":"2025-05-06T06:55:53.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-11T04:27:55.603Z","etag":null,"topics":["async","asyncio","asyncronous","concurrency","python","worker"],"latest_commit_sha":null,"homepage":"https://ashraful.dev","language":"Python","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/iashraful.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2024-10-15T11:08:56.000Z","updated_at":"2024-12-24T10:39:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"48bc7506-2a2d-41d5-91bc-4c62823178ff","html_url":"https://github.com/iashraful/async-coro-runner","commit_stats":null,"previous_names":["iashraful/async-coro-runner"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/iashraful/async-coro-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iashraful%2Fasync-coro-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iashraful%2Fasync-coro-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iashraful%2Fasync-coro-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iashraful%2Fasync-coro-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iashraful","download_url":"https://codeload.github.com/iashraful/async-coro-runner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iashraful%2Fasync-coro-runner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266633250,"owners_count":23959521,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["async","asyncio","asyncronous","concurrency","python","worker"],"created_at":"2025-03-28T02:03:25.524Z","updated_at":"2026-03-09T13:36:57.522Z","avatar_url":"https://github.com/iashraful.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AsyncIO Task Runner (Coro Runner)\n\n[![Test OK!](https://github.com/iashraful/async-coro-runner/actions/workflows/tests-runner.yml/badge.svg?branch=main)](https://github.com/iashraful/async-coro-runner/actions/workflows/tests-runner.yml)\n[![Publich Package](https://github.com/iashraful/async-coro-runner/actions/workflows/packaging.yml/badge.svg?branch=main)](https://github.com/iashraful/async-coro-runner/actions/workflows/packaging.yml)\n[![PyPI](https://img.shields.io/pypi/v/coro-runner?label=Python%20Package)](https://pypi.org/project/coro-runner/)\n\nThe **AsyncIO Task Runner** (Coro Runner) is a Python utility designed for managing concurrent asynchronous tasks using the built-in `asyncio` module. It provides an efficient way to execute multiple tasks in a single-threaded environment with customizable concurrency limits.\n\nThis project leverages `asyncio` (introduced in Python 3.4) to simplify handling of asynchronous workloads, making it ideal for lightweight, scalable applications.\n\n## Features\n\n- **Configurable Concurrency**: Define the number of concurrent tasks when initializing the runner.\n- **Efficient Task Management**: Run multiple tasks concurrently with streamlined execution control.\n- **Worker Queue**: Multiple queue can be configued along with their priority.\n\n### Planned Enhancements\n\n- **Monitoring Tool Integration**: Support for real-time task monitoring and analytics.\n- **Low-Level API**: Features such as callbacks, acknowledgments, and error handling for advanced use cases.\n- **Robust Logging**: Detailed logging to track task execution and debug issues.\n\n## Getting Started\n\n### Installation\n\nTo install `coro-runner`, use pip:\n\n```bash\npip install coro-runner\n```\n\n### Full documentation\n\u003e\n\u003e [Here is the full documentation](https://github.com/iashraful/async-coro-runner/tree/main/coro_runner/docs/docs.md)\n\n### Quickstart\n\n- Define and schedule tasks:\n\n  ```python\n  from coro_runner import CoroRunner\n\n\n  runner = CoroRunner(concurrency=25)\n  # Add your tasks from anywhere b       \n  runner.add_task(your_task()) # your_task must be a coroutine or future like object\n  ```\n\n- Task lifecycle management: (On app start and end you must run the runner. Don't worry it'll run under same process.)\n\n  ```python\n  async def startup():\n      await runner.run_until_exit()\n  \n  async def shutdown():\n      await runner.cleanup()\n  ```\n\n### Prerequisites\n\n- Python 3.12 or later\n- [Poetry](https://python-poetry.org/) for dependency management\n\n### Installation and Setup\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/iashraful/async-coro-runner.git\n   cd async-coro-runner\n   ```\n\n2. Activate the virtual environment:\n\n   ```bash\n   poetry shell\n   ```\n\n3. Install dependencies:\n\n   ```bash\n   poetry install\n   ```\n\n### Running Tests\n\nRun the test suite to verify the setup:\n\n```bash\npytest -s\n```\n\n**Sample Output:**\n\n```text\nTask started:  Task-1\nTask ended:    Task-1\n...\n```\n\n## Example Usage\n\nThe project includes an example API implemented with FastAPI. It demonstrates how to use the task runner to manage asynchronous tasks.\n\n### Starting the API\n\n1. Run the API server:\n\n   ```bash\n   uvicorn example:app --reload\n   ```\n\n2. Trigger tasks using the endpoint:\n\n   ```bash\n   GET /fire-task?count=25\n   ```\n\n## How to Contribute\n\nContributions are welcome! Follow these steps to get started:\n\n1. Fork the repository and create a new branch for your feature or bug fix.\n2. Write tests for your changes.\n3. Open a pull request with a clear description of your contribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiashraful%2Fasync-coro-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiashraful%2Fasync-coro-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiashraful%2Fasync-coro-runner/lists"}