Skip to content

Gio.IOSchedulerJob

record (struct)

:::warning Deprecated since 2.36 This API is deprecated. :::

Opaque class for defining and scheduling IO jobs.

Methods

send_to_mainloop

def send_to_mainloop(self, func: GLib.SourceFunc) -> bool

:::warning Deprecated since 2.36 This API is deprecated. :::

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).

Parameters:

  • func — a GSourceFunc callback that will be called in the original thread

send_to_mainloop_async

def send_to_mainloop_async(self, func: GLib.SourceFunc) -> None

:::warning Deprecated since 2.36 This API is deprecated. :::

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 io_scheduler_push_job on to this function you have to ensure that it is not freed before func is called, either by passing None as notify to io_scheduler_push_job or by using refcounting for user_data.

Parameters:

  • func — a GSourceFunc callback that will be called in the original thread