AgsTask

AgsTask — Perform operations in a thread safe context.

Functions

Properties

AgsTaskThread * task-thread Read / Write

Signals

Types and Values

enum AgsTaskFlags
#define AGS_TYPE_TASK
struct AgsTask
struct AgsTaskClass

Object Hierarchy

    GObject
    ╰── AgsTask

Implemented Interfaces

AgsTask implements AgsConnectable.

Includes

#include <ags/thread/ags_task.h>

Description

AgsTask object acts an interceptor in a thread safe context.

Functions

ags_task_launch ()

void
ags_task_launch (AgsTask *task);

Intercept task.

Parameters

task

an AgsTask

 

Since: 1.0.0


ags_task_failure ()

void
ags_task_failure (AgsTask *task,
                  GError *error);

Signals failure of task.

Parameters

task

an AgsTask

 

error

is NULL on success

 

Since: 1.0.0


ags_task_new ()

AgsTask *
ags_task_new ();

Creates a AgsTask

Returns

a new AgsTask

Since: 1.0.0


AGS_IS_TASK()

#define AGS_IS_TASK(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_TASK))

AGS_TASK()

#define AGS_TASK(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_TASK, AgsTask))

AGS_TASK_CLASS()

#define AGS_TASK_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_TASK, AgsTaskClass))

AGS_TASK_GET_CLASS()

#define AGS_TASK_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_TASK, AgsTaskClass))

ags_task_get_type ()

GType
ags_task_get_type ();

Types and Values

enum AgsTaskFlags

Enum values to control the behavior or indicate internal state of AgsTask by enable/disable as flags.

Members

AGS_TASK_LOCKED

the task is locked

 

AGS_TASK_CYCLIC

call task repeatedly

 

AGS_TYPE_TASK

#define AGS_TYPE_TASK                (ags_task_get_type())

struct AgsTask

struct AgsTask;

struct AgsTaskClass

struct AgsTaskClass {
  GObjectClass object;

  void (*launch)(AgsTask *task);

  void (*failure)(AgsTask *task, GError *error);
};

Property Details

The “task-thread” property

  “task-thread”              AgsTaskThread *

The assigned AgsTaskThread

Flags: Read / Write

Since: 1.0.0

Signal Details

The “failure” signal

void
user_function (AgsTask *task,
               gpointer error,
               gpointer user_data)

The ::failure signal is emited if ::launch fails

Parameters

task

the AgsTask failed to do its work.

 

error

the GError

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0


The “launch” signal

void
user_function (AgsTask *task,
               gpointer user_data)

The ::launch signal is emited in a thread safe context

Parameters

task

the AgsTask to launch.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0