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
When coding with Roblox's own API, and using instance:WaitForChild(childName), you get a warning after 7 seconds that tells you that the yield is unusually long.
With the WaitFor module, that isn't a feature but instead, the default timeout is 60 seconds, and the timeout forces the promise's "yield" to reject and error.
This behavior is fine, and I am making the assumption that 60 seconds force timeout time was set with slow runtimes running WaitFor code in mind, however, as I was testing earlier today some code for my game that uses WaitFor, I realized that the WaitFor wasn't resolving in an expected time frame and I stopped the test almost immediately after and started to print debug the code.
This is not very ideal as it takes more time than it has to take, and if I were to wait 60 seconds at least before closing my game, I would have figured out the exact problem!
With Roblox's own API in mind, I think introducing an "unusual length warning" would do well for the WaitFor module, and being able to set this value somehow (not required but would be nice) would also be good. I think that 7 seconds unusual yielding time would work perfectly, as it has for Roblox throughout all these years.
I do not want to create a PR alongside this since WaitFor uses promise functionality which I have no experience in using, so instead I am making this issue with a code snippet of how unusual yield time warnings could be introduced.
I am hoping that someone can create a PR, or that Sleitnick can just update the module himself if he thinks this functionality can be introduced.
Here's the code snippet of how you can implement the functionality described above when creating a Promise.
localunusualYieldWarn=task.delay(7, function()
warn("Unusual yielding time for Promise, etc")
end)
localpromise=Promise.new(function(resolve)
-- Do whatever you want in your promise hereifpromiseResolvedSomehowthentask.cancel(unusualYieldWarn)
resolve()
endend)
The text was updated successfully, but these errors were encountered:
When coding with Roblox's own API, and using instance:WaitForChild(childName), you get a warning after 7 seconds that tells you that the yield is unusually long.
With the WaitFor module, that isn't a feature but instead, the default timeout is 60 seconds, and the timeout forces the promise's "yield" to reject and error.
This behavior is fine, and I am making the assumption that 60 seconds force timeout time was set with slow runtimes running WaitFor code in mind, however, as I was testing earlier today some code for my game that uses WaitFor, I realized that the WaitFor wasn't resolving in an expected time frame and I stopped the test almost immediately after and started to print debug the code.
This is not very ideal as it takes more time than it has to take, and if I were to wait 60 seconds at least before closing my game, I would have figured out the exact problem!
With Roblox's own API in mind, I think introducing an "unusual length warning" would do well for the WaitFor module, and being able to set this value somehow (not required but would be nice) would also be good. I think that 7 seconds unusual yielding time would work perfectly, as it has for Roblox throughout all these years.
I do not want to create a PR alongside this since WaitFor uses promise functionality which I have no experience in using, so instead I am making this issue with a code snippet of how unusual yield time warnings could be introduced.
I am hoping that someone can create a PR, or that Sleitnick can just update the module himself if he thinks this functionality can be introduced.
Here's the code snippet of how you can implement the functionality described above when creating a Promise.
The text was updated successfully, but these errors were encountered: