IOSchedulerJob#
Deprecated since version 2.36:
- Use
ThreadPool
or
- class IOSchedulerJob(*args, **kwargs)#
Opaque class for defining and scheduling IO jobs.
Methods#
- class IOSchedulerJob
- send_to_mainloop(func: Callable[[Any], bool], user_data: Any = None) 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 since version 2.36: Use
invoke()
.- Parameters:
func – a
SourceFunc
callback that will be called in the original threaduser_data – data to pass to
func
- send_to_mainloop_async(func: Callable[[Any], bool], user_data: Any = None) 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
fromio_scheduler_push_job()
on to this function you have to ensure that it is not freed beforefunc
is called, either by passingNone
asnotify
toio_scheduler_push_job()
or by using refcounting foruser_data
.Deprecated since version 2.36: Use
invoke()
.- Parameters:
func – a
SourceFunc
callback that will be called in the original threaduser_data – data to pass to
func