{"id":22414859,"url":"https://github.com/softlr/taskex","last_synced_at":"2025-03-27T03:45:17.743Z","repository":{"id":41989759,"uuid":"483526745","full_name":"Softlr/TaskEx","owner":"Softlr","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-20T10:16:02.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T09:21:25.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Softlr.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}},"created_at":"2022-04-20T06:01:09.000Z","updated_at":"2022-04-20T06:36:51.000Z","dependencies_parsed_at":"2022-08-12T01:40:10.375Z","dependency_job_id":null,"html_url":"https://github.com/Softlr/TaskEx","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/Softlr%2FTaskEx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Softlr%2FTaskEx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Softlr%2FTaskEx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Softlr%2FTaskEx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Softlr","download_url":"https://codeload.github.com/Softlr/TaskEx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245779446,"owners_count":20670685,"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":[],"created_at":"2024-12-05T15:09:49.489Z","updated_at":"2025-03-27T03:45:17.725Z","avatar_url":"https://github.com/Softlr.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![.NET](https://github.com/Softlr/TaskEx/actions/workflows/dotnet.yml/badge.svg)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=taskex\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=taskex)\n\n# Description\nThis library contains extensions for tasks.\n\n# Installation\n```ps\ndotnet add package Softlr.TaskEx\n```\n\n# Usage\n## Awaiting multiple tasks\nThe library provides a simple way of awaiting multiple task results with as little code as possible.\n\nTypically when you want to await multiple tasks you will be doing something like\n```csharp\ntask1.Start();\ntask2.Start();\nawait task1;\nawait task2;\n```\nor\n```\nawait Task.WhenAll(task1, task2);\n```\n\nWith this library you can simplify this to\n```csharp\nawait (task1, task2);\n```\n\n## Awaiting multiple tasks with results\nBut the real improvement is if you need to await multiple tasks that return some values.\nTypically you'd do something like\n```csharp\ntask1.Start();\ntask2.Start();\nvar result1 = await task1;\nvar result2 = await task2;\n```\n\nThis can be simplified using this library to\n```csharp\nvar (result1, result2) = await (task1, task2);\n```\n\nThe results can be of completely different types, the tasks will run simultanously but the code will wait until all of the tasks finish processing.\nThis method can be used to await results for up to 7 tasks at the same time (7 is the limit of generic parameters of the `TaskAwaiter` class on which this code depends).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlr%2Ftaskex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftlr%2Ftaskex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlr%2Ftaskex/lists"}