{"id":21886258,"url":"https://github.com/cookednick/awaitreturn","last_synced_at":"2025-03-22T01:44:32.934Z","repository":{"id":220024410,"uuid":"750564987","full_name":"CookedNick/AwaitReturn","owner":"CookedNick","description":"(Swift) Return values from asynchronous contexts into concurrent ones.","archived":false,"fork":false,"pushed_at":"2024-01-31T23:27:23.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T20:11:17.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/CookedNick.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":"2024-01-30T21:58:24.000Z","updated_at":"2024-01-30T21:58:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcb32135-2808-44c4-8f87-d2c08bdba462","html_url":"https://github.com/CookedNick/AwaitReturn","commit_stats":null,"previous_names":["cookednick/awaitreturn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookedNick%2FAwaitReturn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookedNick%2FAwaitReturn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookedNick%2FAwaitReturn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CookedNick%2FAwaitReturn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CookedNick","download_url":"https://codeload.github.com/CookedNick/AwaitReturn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244894309,"owners_count":20527669,"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-28T10:33:52.186Z","updated_at":"2025-03-22T01:44:32.917Z","avatar_url":"https://github.com/CookedNick.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sometimes, within a concurrent context, you need data that is only accessible via asynchronous code. For example, actors work by requiring `await` statements before their data can be accessed.\nThere is no easy one-line way to do this in Swift as of Swift 5.9.2. **AwaitReturn is one easy way to do this.**\n\n## Usage\n\n```swift\nfunc getName() {\n    // Within the awaitReturn block, you can write async code and return it normally.\n    let name = awaitReturn { await someActor.name }\n    // We now have a \"name\" constant of type String in our concurrent context.\n    print(name)\n}\n```\n\n## Installation\n\nInclude `AwaitReturn.swift` in your project. That's it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcookednick%2Fawaitreturn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcookednick%2Fawaitreturn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcookednick%2Fawaitreturn/lists"}