Worker
Object Hierarchy:
Description:
[ CCode ( ref_function = "gda_worker_ref" , type_id = "gda_worker_get_type ()" , unref_function = "gda_worker_unref" ) ]
[ Compact ]
public class Worker
Content:
Static methods:
Creation methods:
Methods:
- public Worker @ref ()
Increases this's reference count.
- public bool cancel_job (uint job_id) throws Error
Cancels a job which has not yet been processed.
- public bool do_job (MainContext? context, int timeout_ms, void* out_result, uint? out_job_id, owned WorkerFunc func, DestroyNotify? data_destroy_func) throws Error
Request that the worker thread call func with the
data argument, much like submit_job, but waits (starting a
MainLoop) for a maximum of timeout_ms miliseconds for
func to be executed.
- public bool fetch_job_result (uint job_id, void* out_result) throws Error
Fetch the value returned by execution the job_id job.
- public void forget_job (uint job_id)
Forget all about the job with ID job_id.
- public unowned Thread get_worker_thread ()
Get a pointer to this's inner worker
thread
- public Worker new_unique (bool allow_destroy)
- public bool set_callback (MainContext? context, WorkerCallback? callback) throws Error
Declare a callback function to be called when a job has been
processed.
- public uint submit_job (MainContext? callback_context, owned WorkerFunc func, DestroyNotify? data_destroy_func) throws Error
Request that the worker thread call func with the
data argument.
- public bool thread_is_worker ()
Tells if the thread from which this function is called is
this's worker thread.
- public void unref ()
Decreases this's reference count.
- public void* wait_job (owned WorkerFunc func) throws Error
Request that the worker thread call func with the
data argument, much like submit_job, but waits (blocks) until
func has been executed.