{"id":28120935,"url":"https://github.com/li0k/coro","last_synced_at":"2025-09-20T22:47:47.349Z","repository":{"id":108480556,"uuid":"141799482","full_name":"Li0k/Coro","owner":"Li0k","description":" A coroutine library for c++ only for study","archived":false,"fork":false,"pushed_at":"2018-07-21T10:02:15.000Z","size":431,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T07:51:12.389Z","etag":null,"topics":["coroutine","cpp","ucontext"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Li0k.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,"zenodo":null}},"created_at":"2018-07-21T09:37:36.000Z","updated_at":"2018-07-24T07:23:24.000Z","dependencies_parsed_at":"2023-04-25T22:16:30.871Z","dependency_job_id":null,"html_url":"https://github.com/Li0k/Coro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Li0k/Coro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Li0k%2FCoro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Li0k%2FCoro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Li0k%2FCoro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Li0k%2FCoro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Li0k","download_url":"https://codeload.github.com/Li0k/Coro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Li0k%2FCoro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276169665,"owners_count":25596956,"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-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["coroutine","cpp","ucontext"],"created_at":"2025-05-14T07:42:01.302Z","updated_at":"2025-09-20T22:47:47.343Z","avatar_url":"https://github.com/Li0k.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coro\n\nA coroutine library for c++ only for study\n\nuse ucontext\n\nprovide a schedule Coro to handle the coroutine\n\nprovide some function\n\n- create\n\n  ```c++\n  int create(const coroutine_func \u0026f);\n  ```\n\n  create a coroutine and return its id\n\n- resume\n\n  ```c++\n  void resume(int id);\n  ```\n\n  use id to resume a coroutine you want\n\n- yield\n\n  ```c++\n  void yield();\n  ```\n\n  to yield a coroutine \n\n- other\n\n  use marco to change property of Coro and coroutine\n\n  - MAX_STACK_SIZE  \n\n    set the max size of coroutine runnning stack \n\n  - DEFAULT_NUM\n\n    set the default num of coroutine\n\n  - CO_NUM_LIMIT\n\n    set the max num of coroutine\n\notherwise Coro provide a Channel class to transfer some message from main thread to coroutine,but it only a toy\n\nit provide some function\n\n- pop\n\n  ```c++\n  template\u003ctypename Type\u003e\n  Type \u0026Channel\u003cType\u003e::pop()\n  ```\n\n- push\n\n  ```c++\n  template\u003ctypename Type\u003e\n  void Channel\u003cType\u003e::push(const Type \u0026v)\n  ```\n\n\n\nsome example in test1.cpp and test2.cpp","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fli0k%2Fcoro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fli0k%2Fcoro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fli0k%2Fcoro/lists"}