{"id":13822236,"url":"https://github.com/cmarshall108/libasynctasks","last_synced_at":"2025-10-31T07:39:54.819Z","repository":{"id":85478075,"uuid":"147984988","full_name":"cmarshall108/libasynctasks","owner":"cmarshall108","description":"A fast, lightweight, dynamic task based framework built for scalable concurrency written in Python extended with Cython.","archived":false,"fork":false,"pushed_at":"2018-09-13T02:49:38.000Z","size":35,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T18:39:16.144Z","etag":null,"topics":["asynchronous","concurrency","coroutines","cython","python","python-2","python-3","task-scheduler"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmarshall108.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-09-09T02:00:45.000Z","updated_at":"2020-06-25T20:04:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"164791a6-6c47-43bd-8477-792c78abd898","html_url":"https://github.com/cmarshall108/libasynctasks","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/cmarshall108%2Flibasynctasks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmarshall108%2Flibasynctasks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmarshall108%2Flibasynctasks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmarshall108%2Flibasynctasks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmarshall108","download_url":"https://codeload.github.com/cmarshall108/libasynctasks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065862,"owners_count":21041981,"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":["asynchronous","concurrency","coroutines","cython","python","python-2","python-3","task-scheduler"],"created_at":"2024-08-04T08:01:50.099Z","updated_at":"2025-10-31T07:39:54.729Z","avatar_url":"https://github.com/cmarshall108.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# libasynctasks\n\nA framework built for fast, lightweight, dynamic concurrency. In order to achieve such,\nwe must understand how the task management system works. Each task has a function in which is called\nby the TaskManager (provided the given arguments, etc...) these tasks run on TaskSchedulers (\nwhich are a pool of threads). Tasks run in this order in attempt to achieve fast, efficient concurrency.\nImplementing ```async/await``` functionality is planned and will work like the following:\n\n```python\n\nasync def some_other_func():\n    # do some random math for example...\n    a = 5\n    a = a ** 100\n    a ^= 50\n    print ('some_other_func', a)\n\nasync def test_func(task):\n    await some_other_func()\n    return task.cont\n\ntask_1 = task_manager.add_task('task_1', test_func)\n```\n\nThis will allow you to achieve optimal performance fully taking advantage\nof Python3's ```async/await```. libasynctasks is backwards compatible with Python2, with this being said ```async/await``` is not supported in Python2 and will most likely never be... However, there is a potential solution for such, this involves Python2's generators which are created by the ```yield``` keyword; this is still in debate...\n\n# Examples\n\n## Using continued tasks\n```python\nfrom libasynctasks import TaskManager\n\n\ndef test_task_1(task):\n    print ('test_task_1', 'ran')\n    return task.cont\n\ndef test_task_2(task):\n    print ('test_task_2', 'ran')\n    return task.cont\n\ndef test_task_3(task):\n    print ('test_task_3', 'ran')\n    return task.cont\n\ndef test_task_4(task):\n    print ('test_task_4', 'ran')\n    return task.cont\n\ntask_manager = TaskManager()\n\ntask_1 = task_manager.add_task('task_1', test_task_1)\ntask_2 = task_manager.add_task('task_2', test_task_2)\ntask_3 = task_manager.add_task('task_3', test_task_3)\ntask_4 = task_manager.add_task('task_4', test_task_4)\n\nprint (task_1)\nprint (task_2)\nprint (task_3)\nprint (task_4)\n\ntask_manager.run() # blocking\n```\n\n## Using delayed tasks\n```python\nfrom libasynctasks import TaskManager\n\n\ndef test_task_1(task):\n    print ('test_task_1', 'ran')\n    return task.wait\n\ndef test_task_2(task):\n    print ('test_task_2', 'ran')\n    return task.wait\n\ndef test_task_3(task):\n    print ('test_task_3', 'ran')\n    return task.wait\n\ndef test_task_4(task):\n    print ('test_task_4', 'ran')\n    return task.wait\n\ntask_manager = TaskManager()\n\ntask_1 = task_manager.add_task('task_1', test_task_1, delay=10)\ntask_2 = task_manager.add_task('task_2', test_task_2, delay=10)\ntask_3 = task_manager.add_task('task_3', test_task_3, delay=10)\ntask_4 = task_manager.add_task('task_4', test_task_4, delay=10)\n\nprint (task_1)\nprint (task_2)\nprint (task_3)\nprint (task_4)\n\ntask_manager.run() # blocking\n```\n\n# License\n\nlibasynctasks is licensed under the \"\nBSD 3-Clause License\" for more info, refer to the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmarshall108%2Flibasynctasks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmarshall108%2Flibasynctasks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmarshall108%2Flibasynctasks/lists"}