{"id":15291151,"url":"https://github.com/azure/go-asynctask","last_synced_at":"2025-04-09T08:11:40.618Z","repository":{"id":38317848,"uuid":"244511894","full_name":"Azure/go-asynctask","owner":"Azure","description":"Simple mimic of async/await for those come from C# world, now you can Cancel(), Wait() on a go routine.","archived":false,"fork":false,"pushed_at":"2025-02-17T05:48:06.000Z","size":136,"stargazers_count":57,"open_issues_count":2,"forks_count":11,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-04-09T08:11:29.116Z","etag":null,"topics":["async","go","golang","routine"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Azure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-03T01:16:19.000Z","updated_at":"2025-03-15T08:31:37.000Z","dependencies_parsed_at":"2024-05-06T07:25:45.035Z","dependency_job_id":"2d74b48f-8d63-457c-90ba-cae2847569d2","html_url":"https://github.com/Azure/go-asynctask","commit_stats":{"total_commits":108,"total_committers":6,"mean_commits":18.0,"dds":"0.42592592592592593","last_synced_commit":"0cfea47d873345c3c908225c04ae8418219e19f7"},"previous_names":["azure/asynctask"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-asynctask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-asynctask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-asynctask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgo-asynctask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/go-asynctask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999864,"owners_count":21031046,"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","go","golang","routine"],"created_at":"2024-09-30T16:11:08.989Z","updated_at":"2025-04-09T08:11:40.603Z","avatar_url":"https://github.com/Azure.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AsyncTask\r\n\r\n![Build](https://github.com/Azure/go-asynctask/workflows/Go/badge.svg?branch=master)\r\n[![Go Report Card](https://goreportcard.com/badge/github.com/Azure/go-asynctask)](https://goreportcard.com/report/github.com/Azure/go-asynctask)\r\n[![GoDoc](https://godoc.org/github.com/Azure/go-asynctask?status.svg)](https://godoc.org/github.com/Azure/go-asynctask)\r\n[![Codecov](https://img.shields.io/codecov/c/github/Azure/go-asynctask)](https://codecov.io/gh/Azure/go-asynctask)\r\n\r\nSimple mimik of async/await for those come from C# world, so you don't need to dealing with waitGroup/channel in golang.\r\n\r\nalso the result is strongTyped with go generics, no type assertion is needed.\r\n\r\nfew chaining method provided:\r\n- ContinueWith: send task1's output to task2 as input, return reference to task2.\r\n- AfterBoth : send output of taskA, taskB to taskC as input, return reference to taskC.\r\n- WaitAll: all of the task have to finish to end the wait (with an option to fail early if any task failed)\r\n- WaitAny: any of the task finish would end the wait\r\n\r\n```golang\r\n    // start task\r\n    task := asynctask.Start(ctx, countingTask)\r\n    \r\n    // do something else\r\n    somethingelse()\r\n    \r\n    // get the result\r\n    rawResult, err := task.Wait()\r\n    // or\r\n    task.Cancel()\r\n```\r\n\r\n# Contributing\r\n\r\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fgo-asynctask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fgo-asynctask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fgo-asynctask/lists"}