Task.this

this(void * ptr, Flag!"Take" take)
No documentation available for this declaration.
this(gobject.object.ObjectWrap sourceObject = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)

Creates a #GTask acting on source_object, which will eventually be used to invoke callback in the current [thread-default main context][g-main-context-push-thread-default].

Call this in the "start" method of your asynchronous method, and pass the #GTask around throughout the asynchronous operation. You can use [gio.task.Task.setTaskData] to attach task-specific data to the object, which you can retrieve later via [gio.task.Task.getTaskData].

By default, if cancellable is cancelled, then the return value of the task will always be [gio.types.IOErrorEnum.Cancelled], even if the task had already completed before the cancellation. This allows for simplified handling in cases where cancellation may imply that other objects that the task depends on have been destroyed. If you do not want this behavior, you can use [gio.task.Task.setCheckCancellable] to change it.

Parameters

sourceObjectthe #GObject that owns this task, or null.
cancellableoptional #GCancellable object, null to ignore.
callbacka #GAsyncReadyCallback.

Returns

a #GTask.