{"id":19316012,"url":"https://github.com/socketry/async-await","last_synced_at":"2025-04-07T13:06:37.847Z","repository":{"id":59150764,"uuid":"100558745","full_name":"socketry/async-await","owner":"socketry","description":"Why wait? It's available today!","archived":false,"fork":false,"pushed_at":"2024-06-04T05:29:26.000Z","size":52,"stargazers_count":76,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-31T11:04:12.024Z","etag":null,"topics":["async","await","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/socketry.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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-17T03:46:54.000Z","updated_at":"2025-03-17T08:12:09.000Z","dependencies_parsed_at":"2024-06-20T23:36:06.752Z","dependency_job_id":null,"html_url":"https://github.com/socketry/async-await","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-await","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-await/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-await/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-await/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketry","download_url":"https://codeload.github.com/socketry/async-await/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"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","ruby"],"created_at":"2024-11-10T01:09:25.883Z","updated_at":"2025-04-07T13:06:37.829Z","avatar_url":"https://github.com/socketry.png","language":"Ruby","readme":"# Async::Await\n\nImplements the async/await pattern for Ruby using [async](https://github.com/socketry/async).\n\n[![Development Status](https://github.com/socketry/async-await/workflows/Test/badge.svg)](https://github.com/socketry/async-await/actions?workflow=Test)\n\n## Installation\n\n``` shell\nbundle add async-await\n```\n\n## Usage\n\nIn any asynchronous context (e.g. a reactor), simply use the `await` function like so:\n\n``` ruby\nrequire 'async/await'\n\nclass Coop\n\tinclude Async::Await\n\t\n\tasync def count_chickens(area_name)\n\t\t3.times do |i|\n\t\t\tsleep rand\n\t\t\t\n\t\t\tputs \"Found a chicken in the #{area_name}!\"\n\t\tend\n\tend\n\n\tasync def count_all_chickens\n\t\t# These methods all run at the same time.\n\t\tcount_chickens(\"garden\")\n\t\tcount_chickens(\"house\")\n\t\t\n\t\t# We wait for the result\n\t\tcount_chickens(\"tree\").wait\n\tend\nend\n\ncoop = Coop.new\ncoop.count_all_chickens\n```\n\n## Contributing\n\nWe welcome contributions to this project.\n\n1.  Fork it.\n2.  Create your feature branch (`git checkout -b my-new-feature`).\n3.  Commit your changes (`git commit -am 'Add some feature'`).\n4.  Push to the branch (`git push origin my-new-feature`).\n5.  Create new Pull Request.\n\n### Developer Certificate of Origin\n\nThis project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.\n\n### Contributor Covenant\n\nThis project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fasync-await","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketry%2Fasync-await","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fasync-await/lists"}