{"id":28717410,"url":"https://github.com/versusvoid/qcosignal","last_synced_at":"2026-04-24T22:37:00.581Z","repository":{"id":297027389,"uuid":"995407930","full_name":"versusvoid/qcosignal","owner":"versusvoid","description":"Qt bound coroutines","archived":false,"fork":false,"pushed_at":"2025-06-03T13:12:28.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-03T23:24:17.523Z","etag":null,"topics":["async-await","coroutines","cpp","cpp20","qt"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/versusvoid.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-03T12:42:06.000Z","updated_at":"2025-06-03T15:49:52.000Z","dependencies_parsed_at":"2025-06-03T23:24:19.900Z","dependency_job_id":"56c56f1c-c35c-4bf3-ab84-6a2f8bd13f33","html_url":"https://github.com/versusvoid/qcosignal","commit_stats":null,"previous_names":["versusvoid/qcosignal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/versusvoid/qcosignal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versusvoid%2Fqcosignal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versusvoid%2Fqcosignal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versusvoid%2Fqcosignal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versusvoid%2Fqcosignal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/versusvoid","download_url":"https://codeload.github.com/versusvoid/qcosignal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/versusvoid%2Fqcosignal/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259914924,"owners_count":22931334,"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":["async-await","coroutines","cpp","cpp20","qt"],"created_at":"2025-06-15T03:15:38.517Z","updated_at":"2026-04-24T22:36:55.562Z","avatar_url":"https://github.com/versusvoid.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qt bound coroutines\n\nBasic coroutines implementation in [single header](qcosignal.hpp) for exactly two use-cases:\n\n1. awaiting for some signal:\n```cpp\n    ...\n    co_await CoSignal(sender, \u0026Sender::signal);\n    ...\n```\n2. awaiting for concurrent result:\n```cpp\n    ...\n    QString result = co_await QtConcurrent::run(\u0026concurrent_function_with_result, arg);\n    ...\n```\n\nCoroutines are defined as methods of `QObject`-derived class:\n```cpp\nAsync\u003c\u003e MyObject::testAwaitFutureWithResult()\n{\n    qDebug() \u003c\u003c \"awaiting concurrent future\";\n    QString result = co_await QtConcurrent::run(\u0026concurrent_with_result, 1);\n    qDebug() \u003c\u003c \"concurrent future result:\" \u003c\u003c result;\n}\n```\nand are bound to `QObject* this` (i.e. destroyed when `this` is destroyed).\n\nCoroutine awaiting on signal will also be destroyed if expected sender is destroyed,\nso there won't be indefinite hangs.\n\nImplementation is missing some opportunities for move-semantics optimization, but I'm lacking\nenough instinctive understanding of it in C++.\n\nProbably not \"serious production\"-ready, but fully intended to be used in my pet project and\nextended as necessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fversusvoid%2Fqcosignal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fversusvoid%2Fqcosignal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fversusvoid%2Fqcosignal/lists"}