Top | ![]() |
![]() |
![]() |
![]() |
Progress notification system for asynchronous operationsProgress notification system for asynchronous operations — Values representing progress |
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.
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
);
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.