handle2 methods, 1 field
Op
The in-flight acknowledgment of an effectful operation (a write, delete, or create; a package install or removal). Await :ready() to observe completion or failure — file:write(bytes):ready() is the check-now idiom. Dropping an unawaited handle discards the outcome; the operation itself still runs.
- Obtained from
Storage:set, Storage:delete, Document:set, Document:delete, Document:delete_prefix, Dir:create_file, Dir:mkdir, Dir:remove and 4 more
Wait until this operation completes, then return the same handle for chaining. Raises if the operation failed. A completed handle returns at once.
In the guide: Open, pick and save files Save data between runs List and install packages
Op:on_done
methodOp:on_done(callback?: fun(handle: Op))Set, replace, or clear (pass nil) the callback run once, as a callback of its own, when this operation leaves pending. On a handle that has already left it, the callback runs after the current callback returns, never during this call. A set callback keeps the operation's outcome alive, even with no other reference to the handle, and keeps the app running until it runs or is cleared.
In the guide: List and install packages Troubleshooting Waiting: suspending calls and handles