{"id":21528444,"url":"https://github.com/hellokitty/unitysync.async","last_synced_at":"2025-04-09T23:42:32.610Z","repository":{"id":84548409,"uuid":"100685683","full_name":"HelloKitty/Unitysync.Async","owner":"HelloKitty","description":"Unitysync.Async is an async extension library that allows you to use Task and Task\u003cT\u003e with continuations in Unity3D.","archived":false,"fork":false,"pushed_at":"2020-06-25T12:33:42.000Z","size":865,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T07:16:41.200Z","etag":null,"topics":[],"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/HelloKitty.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}},"created_at":"2017-08-18T07:29:51.000Z","updated_at":"2018-11-13T04:45:25.000Z","dependencies_parsed_at":"2023-03-12T23:29:45.392Z","dependency_job_id":null,"html_url":"https://github.com/HelloKitty/Unitysync.Async","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloKitty%2FUnitysync.Async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloKitty%2FUnitysync.Async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloKitty%2FUnitysync.Async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloKitty%2FUnitysync.Async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HelloKitty","download_url":"https://codeload.github.com/HelloKitty/Unitysync.Async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131470,"owners_count":21052819,"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-11-24T01:53:18.604Z","updated_at":"2025-04-09T23:42:32.590Z","avatar_url":"https://github.com/HelloKitty.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unitysync.Async\n\nUnitysync.Async is an async extension library that allows you to use Task and Task\\\u003cT\\\u003e with continuations in Unity3D.\n\n## How to Use\n\nIf you have an async method that returns a Task or Task\\\u003cT\\\u003e then you can register a continuation with an extension method. You can provide various continuation types such as: Action, Action\\\u003cT\\\u003e, Func\\\u003cT, TResult\\\u003e, Func\u003cT, Task\\\u003cTResult\\\u003e\\\u003e and of course supports method delegates/lambdas.\n\nThe way this works is it starts a coroutine on the current Monobehaviour, using the Monobehaviour as a context for the continuation, and fires off the delegate once the async method has completed and the Task completition state is complete.\n\n```csharp\nService.DoSomethingAsync(someData, someMoreData)\n\t.UnityAsyncContinueWith(this, LogAndDipatchResult);\n```\n\n```csharp\nService.DoSomethingAsync(someData, someMoreData)\n\t.UnityAsyncContinueWith(this, result =\u003e SomeEntity.SetResult(result.Something));\n```\n\nYou can schedule multiple continuations on a single Task but the order of their execution is currently undefined if you schedule multiple on the same task.\n\nYou can even do a continuation into an async method which will of course return a Task\\\u003cT\\\u003e which can be continued on again, in a fluent method chaining pattern, and this execution order is defined since they are different tasks.\n\t\n```csharp\nQueryClient.GetAvatarUrl(entityId) //async method that returns an endpoint\n\t\t.UnityAsyncContinueWith(this, GetAvatar2DImage) //async method that queries the endpoint for the avatar image\n\t\t.UnityAsyncContinueWith(this, InitializeAvatarMaterials); //non-async method that initializes the avatar materials\n```\t\n\n## Setup\n\nTo compile or open Unitysync.Async project you'll first need a couple of things:\n\n* Visual Studio 2017\n* Unity 2017.1 with .NET 4.6 enabled\n\n## Builds\n\nNuGet: [Unitysync.Async](https://www.nuget.org/packages/Unitysync.Async/)\n\nMyget: [![hellokitty MyGet Build Status](https://www.myget.org/BuildSource/Badge/hellokitty?identifier=f89338ba-bf06-478a-9131-ab52b4855aa5)](https://www.myget.org/)\n\n## Tests\n\nTODO actual tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellokitty%2Funitysync.async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellokitty%2Funitysync.async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellokitty%2Funitysync.async/lists"}