Plank.Worker.add_task_with_result – plank – Vala Binding Reference

Plank.Worker.add_task_with_result – plank Reference Manual

# add_task_with_result

## Description:

public async G add_task_with_result<G> (owned TaskFunc<G> func, TaskPriority priority = DEFAULT) throws Error

Schedule given function to be run in our ThreadPool The given priority influences execution-time of the task depending on the currently scheduled amount of tasks.

AsyncReadyCallback will be executed on the main-thread through an idle with GLib.Priority.HIGH_IDLE.

## Parameters:

func | the function to be executed returning a typed result
priority | priority of the given function

## Returns:

the typed result