1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00
This commit is contained in:
y5nw 2025-06-23 23:56:34 +02:00 committed by GitHub
commit 008b7f5051
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 229 additions and 78 deletions

View file

@ -7166,12 +7166,12 @@ This allows you easy interoperability for delegating work to jobs.
* When `func` returns the callback is called (in the normal environment)
with all of the return values as arguments.
* Optional: Variable number of arguments that are passed to `func`
* Returns an `AsyncJob` async job.
* `core.register_async_dofile(path)`:
* Register a path to a Lua file to be imported when an async environment
is initialized. You can use this to preload code which you can then call
later using `core.handle_async()`.
### List of APIs available in an async environment
Classes:
@ -8002,6 +8002,15 @@ use the provided load and write functions for this.
* `from_file(filename)`: Experimental. Like `from_string()`, but reads the data
from a file.
`AsyncJob`
----------
An `AsyncJob` is a reference to a job to be run in an async environment.
### Methods
* `cancel()`: try to cancel the job
* Returns whether the job was cancelled.
* A job can only be cancelled if it has not started.
`InvRef`
--------