Gio.Task.prototype.get_context

function get_context(): GLib.MainContext {
    // Gjs wrapper for g_task_get_context()
}
  

Gets the GLib.MainContext that task will return its result in (that is, the context that was the [thread-default main context][g-main-context-push-thread-default] at the point when task was created).

This will always return a non-null value, even if the task's context is the default GLib.MainContext.

Since 2.36

Returns

task's GLib.MainContext