Gio.IOSchedulerJob¶
Fields¶
None
Methods¶
|
|
|
Details¶
- class Gio.IOSchedulerJob¶
Opaque class for defining and scheduling IO jobs.
Deprecated since version 2.36: Use [struct`GLib`.ThreadPool] or [method`Gio`.Task.run_in_thread]
- send_to_mainloop(func, *user_data)[source]¶
- Parameters:
func (
GLib.SourceFunc
) – aGLib.SourceFunc
callback that will be called in the original thread
- Returns:
The return value of func
- Return type:
Used from an I/O job to send a callback to be run in the thread that the job was started from, waiting for the result (and thus blocking the I/O job).
Deprecated since version 2.36: Use g_main_context_invoke().
- send_to_mainloop_async(func, *user_data)[source]¶
- Parameters:
func (
GLib.SourceFunc
) – aGLib.SourceFunc
callback that will be called in the original thread
Used from an I/O job to send a callback to be run asynchronously in the thread that the job was started from. The callback will be run when the main loop is available, but at that time the I/O job might have finished. The return value from the callback is ignored.
Note that if you are passing the user_data from
Gio.io_scheduler_push_job
() on to this function you have to ensure that it is not freed before func is called, either by passingNone
as notify toGio.io_scheduler_push_job
() or by using refcounting for user_data.Deprecated since version 2.36: Use g_main_context_invoke().