:right-sidebar: True IOSchedulerJob =================================================================== .. currentmodule:: gi.repository.Gio .. deprecated:: 2.36 Use :obj:`~gi.repository.GLib.ThreadPool` or :obj:`~gi.repository.Gio.Task.run_in_thread` .. class:: IOSchedulerJob(*args, **kwargs) :no-contents-entry: Opaque class for defining and scheduling IO jobs. Methods ------- .. rst-class:: interim-class .. class:: IOSchedulerJob :no-index: .. method:: send_to_mainloop(func: ~typing.Callable[[...], bool], *user_data: ~typing.Any) -> bool 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:: 2.36 Use :func:`~gi.repository.GLib.MainContext.invoke`. :param func: a :obj:`~gi.repository.GLib.SourceFunc` callback that will be called in the original thread :param user_data: data to pass to ``func`` .. method:: send_to_mainloop_async(func: ~typing.Callable[[...], bool], *user_data: ~typing.Any) -> None 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 :func:`~gi.repository.Gio.io_scheduler_push_job` on to this function you have to ensure that it is not freed before ``func`` is called, either by passing :const:`None` as ``notify`` to :func:`~gi.repository.Gio.io_scheduler_push_job` or by using refcounting for ``user_data``. .. deprecated:: 2.36 Use :func:`~gi.repository.GLib.MainContext.invoke`. :param func: a :obj:`~gi.repository.GLib.SourceFunc` callback that will be called in the original thread :param user_data: data to pass to ``func``