{"id":15888215,"url":"https://github.com/corecii/roblox-lua-cord","last_synced_at":"2025-03-20T10:30:36.996Z","repository":{"id":105909347,"uuid":"103904579","full_name":"Corecii/Roblox-Lua-Cord","owner":"Corecii","description":"Coroutine-like module that plays nice with the Roblox scheduler","archived":false,"fork":false,"pushed_at":"2018-02-02T01:54:05.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T16:11:54.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Corecii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-18T07:04:16.000Z","updated_at":"2020-08-01T21:57:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"89853c37-15ed-4fdc-aba0-0e075269f537","html_url":"https://github.com/Corecii/Roblox-Lua-Cord","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corecii%2FRoblox-Lua-Cord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corecii%2FRoblox-Lua-Cord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corecii%2FRoblox-Lua-Cord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corecii%2FRoblox-Lua-Cord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Corecii","download_url":"https://codeload.github.com/Corecii/Roblox-Lua-Cord/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244594788,"owners_count":20478339,"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-10-06T06:06:41.997Z","updated_at":"2025-03-20T10:30:36.990Z","avatar_url":"https://github.com/Corecii.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Roblox-Lua-Cord\n`Cord` is a module that emulates the abilities of coroutines but allows you to `wait` within Cords. It uses Events instead of using coroutines directly, so it works *within* the scheduler.\n\n[Github: Source and Documentation](https://github.com/Corecii/Roblox-Lua-Cord/blob/master/Cord.lua)  \n[Roblox Module](https://www.roblox.com/catalog/1381006055/redirect): 1381006055 (`require` compatible)  \n[DevForum Thread](https://devforum.roblox.com/t/cord-module-coroutine-like-written-for-the-roblox-event-scheduler/52891)\n\n---\n\nDifferences from coroutines in Roblox\n\n* If the Cord yields, so does the caller. The caller always waits until the Cord calls `:yield`, returns, or errors.\n* If you want to run a Cord in parallel, you can use the `:parallel` method instead of `:resume`.\n  * This will make Cord work like a coroutine\n  * You'll have to check `cord.state` or `cord:resumable()` to make sure the cord can be resumed. If you try to resume a running or finished Cord, it will error.\n  * You can get the arguments passed to `:yield` or the return values using `cord:returned()` or `cord.outArguments`\n* If the Cord errors, so does whatever resumed it.\n  * You can change this behavior by providing an `ErrorBehavior` when you create a Cord. If you do this, you can use Cord.error to check if an error occured.\n    * `Cord:new(function() end, Cord.WARN)` to warn on errors\n    * `Cord:new(function() end, Cord.NONE)` to do nothing on errors\n    * `Cord:new(func, function(cord) --[[handle error]] end)` where the result of the error handler is returned to `:resume`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorecii%2Froblox-lua-cord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorecii%2Froblox-lua-cord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorecii%2Froblox-lua-cord/lists"}