Progress notification system for asynchronous operations

Progress notification system for asynchronous operations — Values representing progress

Synopsis

typedef             OstreeAsyncProgress;
OstreeAsyncProgress * ostree_async_progress_new         (void);
OstreeAsyncProgress * ostree_async_progress_new_and_connect
                                                        (void (*changed) (OstreeAsyncProgress *self, gpointer user_data),
                                                         gpointer user_data);
char *              ostree_async_progress_get_status    (OstreeAsyncProgress *self);
guint               ostree_async_progress_get_uint      (OstreeAsyncProgress *self,
                                                         const char *key);
guint64             ostree_async_progress_get_uint64    (OstreeAsyncProgress *self,
                                                         const char *key);
void                ostree_async_progress_set_status    (OstreeAsyncProgress *self,
                                                         const char *status);
void                ostree_async_progress_set_uint      (OstreeAsyncProgress *self,
                                                         const char *key,
                                                         guint value);
void                ostree_async_progress_set_uint64    (OstreeAsyncProgress *self,
                                                         const char *key,
                                                         guint64 value);
void                ostree_async_progress_finish        (OstreeAsyncProgress *self);

Description

For many asynchronous operations, it's desirable for callers to be able to watch their status as they progress. For example, an user interface calling an asynchronous download operation will want to be able to see the total number of bytes downloaded.

This class provides a mechanism for callees of asynchronous operations to communicate back with callers. It transparently handles thread safety, ensuring that the progress change notification occurs in the thread-default context of the calling operation.

Details

OstreeAsyncProgress

typedef struct OstreeAsyncProgress   OstreeAsyncProgress;

ostree_async_progress_new ()

OstreeAsyncProgress * ostree_async_progress_new         (void);

Returns :

A new progress object. [transfer full]

ostree_async_progress_new_and_connect ()

OstreeAsyncProgress * ostree_async_progress_new_and_connect
                                                        (void (*changed) (OstreeAsyncProgress *self, gpointer user_data),
                                                         gpointer user_data);

ostree_async_progress_get_status ()

char *              ostree_async_progress_get_status    (OstreeAsyncProgress *self);

ostree_async_progress_get_uint ()

guint               ostree_async_progress_get_uint      (OstreeAsyncProgress *self,
                                                         const char *key);

ostree_async_progress_get_uint64 ()

guint64             ostree_async_progress_get_uint64    (OstreeAsyncProgress *self,
                                                         const char *key);

ostree_async_progress_set_status ()

void                ostree_async_progress_set_status    (OstreeAsyncProgress *self,
                                                         const char *status);

ostree_async_progress_set_uint ()

void                ostree_async_progress_set_uint      (OstreeAsyncProgress *self,
                                                         const char *key,
                                                         guint value);

ostree_async_progress_set_uint64 ()

void                ostree_async_progress_set_uint64    (OstreeAsyncProgress *self,
                                                         const char *key,
                                                         guint64 value);

ostree_async_progress_finish ()

void                ostree_async_progress_finish        (OstreeAsyncProgress *self);

Process any pending signals, ensuring the main context is cleared of sources used by this object. Also ensures that no further events will be queued.

self :

Self