diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2023-04-03 03:32:51 +0000 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2023-04-03 03:32:51 +0000 |
commit | c8f4b63cdd236ebfb23094a54050ebe156cd44cb (patch) | |
tree | d94fe3b6f661ca520d26bcb92deac6c0aebd1600 | |
parent | 072d44573672668e8bc8692afaaa7d8a73365660 (diff) | |
parent | 9e48721c0a3d28fc8476e01cb19fcf655891112f (diff) | |
download | gjs-c8f4b63cdd236ebfb23094a54050ebe156cd44cb.tar.gz |
Merge branch 'doc-runAsync' into 'master'
doc: Add Gio and GLib runAsync overrides
See merge request GNOME/gjs!833
-rw-r--r-- | doc/Overrides.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/Overrides.md b/doc/Overrides.md index 07c18314..173aeb4c 100644 --- a/doc/Overrides.md +++ b/doc/Overrides.md @@ -312,6 +312,19 @@ for (const bytes of inputStream.createSyncIterator(4)) { [gbytes]: https://gjs-docs.gnome.org/glib20/glib.bytes [ginputstream]: https://gjs-docs.gnome.org/gio20/gio.inputstream +### Gio.Application.runAsync() + +Returns: +* (`Promise`) + +Similar to [`Gio.Application.run`][gio-application-run] but return a Promise which resolves when +the main loop ends, instead of blocking while the main loop runs. + +This helps avoid the situation where Promises never resolved if you didn't +run the application inside a callback. + +[gio-application-run]: https://gjs-docs.gnome.org/gio20~2.0/gio.application#method-run + ## [GLib](https://gitlab.gnome.org/GNOME/gjs/blob/HEAD/modules/core/overrides/GLib.js) The `GLib` override includes a number of utilities and conveniences for working @@ -379,6 +392,18 @@ Note that this method will unpack source values (e.g. `uint32`) to native values (e.g. `Number`), so some type information may not be fully represented in the result. +### GLib.MainLoop.runAsync() + +Returns: +* (`Promise`) + +Similar to [`GLib.MainLoop.run`][glib-mainloop-run] but return a Promise which resolves when +the main loop ends, instead of blocking while the main loop runs. + +This helps avoid the situation where Promises never resolved if you didn't +run the main loop inside a callback. + +[glib-mainloop-run]: https://gjs-docs.gnome.org/glib20/glib.mainloop#method-run ## [GObject](https://gitlab.gnome.org/GNOME/gjs/blob/HEAD/modules/core/overrides/GObject.js) |