]> git.lizzy.rs Git - lua_async.git/commitdiff
Document resume()
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 6 Aug 2021 20:07:17 +0000 (22:07 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 6 Aug 2021 20:07:17 +0000 (22:07 +0200)
README.md

index 09cc9db008c826e0a67b65fac72b3b5adb539ae8..00f406954ba06f9b6578c42341883faca953e3e6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -63,13 +63,17 @@ This function takes an ID of an existing immediate and cancels it, meaning it wi
 Must be called from an async function.
 Yields the current thread and resumes its execution in the next (if called by an immediate) or current step (if called by an timeout or interval). This uses an immediate internally.
 
+#### `lua_async.sleep(ms)`
+Must be called from an async function.
+Sleeps for `ms` milliseconds and then resumes execution of the current thread. This uses a timeout internally.
+
 #### `lua_async.kill_thread()`
 Must be called from an async function.
 Kills the current thread. This function _never returns_.
 
-#### `lua_async.sleep(ms)`
-Must be called from an async function.
-Sleeps for `ms` milliseconds and then resumes execution of the current thread. This uses a timeout internally.
+#### `lua_async.resume(thread)`
+This function should only be used internally.
+Resumes execution of the thread `thread` and cleans up limiting data once finished. Also makes sure that if an error occurs it is thrown in the parent thread.
 
 #### `lua_async.run()`
 Takes over the current thread and runs the event loop in a `while true` loop. It is highly recommended to only call this from the main thread, since async-old code being called from non-async functions cannot be detected otherwise.