AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Roblox library springlock3/17/2024 ![]() ![]() Yielding lacks easy access to introspection and the ability to cancel an operation if the value is no longer needed.Both of these methods lead to repeating the same tired patterns many times over for checking if the operation was successful. When an asynchronous operation fails or an error is encountered, Lua functions usually either raise an error or return a success value followed by the actual value.It is difficult to deal with running multiple asynchronous operations concurrently and then retrieve all of their values at the end without extraneous machinery.Accidentally yielding the thread is the source of a large class of bugs and race conditions that Roblox developers run into. Your breathing and your heartbeat are causing them to come loose. Phone Guy (FNAF 3, Night 3) I’d recommend that you keep the springlocks wound up. ![]() Do not breathe on the spring locks, as moisture may loosen them, and cause them to break loose. Functions you call can yield without warning, or only yield sometimes, leading to unpredictable and surprising results. Do not touch the spring locks at any time.The way Roblox models asynchronous operations by default is by yielding (stopping) the thread and then resuming it when the future value is available. ![]()
0 Comments
Read More
Leave a Reply. |