Async helpers return value and behaviour on error
Open
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 491
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
This is totally inconsistent:
call
- success:
returns the values from the wrapped coroutine. This is good. - error before first yield:
hangs - error on subsequent yields (assuming the coroutine was passed as a callback):
rethrows error, which means it longjumps out of the gio function and main loop. I don't think this is a safe thing. Rethrowing only happens with coroutine callbacks, normal function callbacks (eg. not using Async helper) just log a warning on error.
start
- success:
returns true and return value from first yield - error on first yield:
false and error - error on subsequent yields:
rethrow
I just wanted to make a PR to fix the hang, but I don't even know what these functions supposed to do on error.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the async helper entry points call and start, then reproduce the listed success and error cases for coroutine and normal callbacks. Before changing behavior, establish the intended error contract; done means consistent, documented return and error behavior across first and subsequent yields without hanging or escaping the main loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100