You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.
If this promise implementation wrapped each callback in a coroutine instead of using xpcall, then wrapping APIs that yield wouldn't require spawn. It would also help guard against cases where users yield intentionally or otherwise.
One thing to note is that we probably lose the ability to track errors after a yield has occurred. The current version bans yielding entirely, a previous version allowed it by virtue of using pcall, and this version would catch errors, but only if they occur before the first yield.
The text was updated successfully, but these errors were encountered:
You might want to take a look at my fork of the F3X Try library. The documentation is available here. I don't really like it though because it doesn't really have any specifications like Promises does, so what it should do is really just whatever I thought GigsD4X may have told me one night. However, it does have a few cool things that might give you good ideas for this library. It wraps all calls in a coroutine, and tracks the traceback along the way. If you do somehow arrive upon an error, it will "compile" the tracebacks into a single error message. It also doesn't create a new Attempt object internally, it reuses the same table object the entire time and simply changes the values accordingly.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If this promise implementation wrapped each callback in a coroutine instead of using
xpcall
, then wrapping APIs that yield wouldn't requirespawn
. It would also help guard against cases where users yield intentionally or otherwise.One thing to note is that we probably lose the ability to track errors after a yield has occurred. The current version bans yielding entirely, a previous version allowed it by virtue of using
pcall
, and this version would catch errors, but only if they occur before the first yield.The text was updated successfully, but these errors were encountered: