mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
Implement API to cancel async jobs
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
535d757563
commit
660151972f
12 changed files with 232 additions and 78 deletions
|
@ -7156,12 +7156,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:
|
||||
|
@ -7992,6 +7992,14 @@ 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.
|
||||
|
||||
`InvRef`
|
||||
--------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue