:right-sidebar: True TaskPool =================================================================== .. currentmodule:: gi.repository.Gst .. class:: TaskPool(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gst.Object`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gst.SharedTaskPool` :Constructors: :: TaskPool(**properties) new() -> Gst.TaskPool Constructors ------------ .. rst-class:: interim-class .. class:: TaskPool :no-index: .. classmethod:: new() -> ~gi.repository.Gst.TaskPool Create a new default task pool. The default task pool will use a regular GThreadPool for threads. Methods ------- .. rst-class:: interim-class .. class:: TaskPool :no-index: .. method:: cleanup() -> None Wait for all tasks to be stopped. This is mainly used internally to ensure proper cleanup of internal data structures in test suites. MT safe. .. method:: dispose_handle(id: None) -> None Dispose of the handle returned by :func:`~gi.repository.Gst.TaskPool.push`. This does not need to be called with the default implementation as the default :obj:`~gi.repository.Gst.TaskPoolClass`::push implementation always returns :const:`None`. This does not need to be called either when calling :func:`~gi.repository.Gst.TaskPool.join`, but should be called when joining is not necessary, but :func:`~gi.repository.Gst.TaskPool.push` returned a non-:const:`None` value. This method should only be called with the same ``pool`` instance that provided ``id``. .. versionadded:: 1.20 :param id: the id .. method:: join(id: None) -> None Join a task and/or return it to the pool. ``id`` is the id obtained from :func:`~gi.repository.Gst.TaskPool.push`. The default implementation does nothing, as the default :obj:`~gi.repository.Gst.TaskPoolClass`::push implementation always returns :const:`None`. This method should only be called with the same ``pool`` instance that provided ``id``. :param id: the id .. method:: prepare() -> None Prepare the taskpool for accepting :func:`~gi.repository.Gst.TaskPool.push` operations. MT safe. .. method:: push(func: ~typing.Callable[[...], None], *user_data: ~typing.Any) -> None Start the execution of a new thread from ``pool``. :param func: the function to call :param user_data: data to pass to ``func`` Virtual Methods --------------- .. rst-class:: interim-class .. class:: TaskPool :no-index: .. method:: do_cleanup() -> None Wait for all tasks to be stopped. This is mainly used internally to ensure proper cleanup of internal data structures in test suites. MT safe. .. method:: do_dispose_handle(id: None) -> None Dispose of the handle returned by :func:`~gi.repository.Gst.TaskPool.push`. This does not need to be called with the default implementation as the default :obj:`~gi.repository.Gst.TaskPoolClass`::push implementation always returns :const:`None`. This does not need to be called either when calling :func:`~gi.repository.Gst.TaskPool.join`, but should be called when joining is not necessary, but :func:`~gi.repository.Gst.TaskPool.push` returned a non-:const:`None` value. This method should only be called with the same ``pool`` instance that provided ``id``. .. versionadded:: 1.20 :param id: the id .. method:: do_join(id: None) -> None Join a task and/or return it to the pool. ``id`` is the id obtained from :func:`~gi.repository.Gst.TaskPool.push`. The default implementation does nothing, as the default :obj:`~gi.repository.Gst.TaskPoolClass`::push implementation always returns :const:`None`. This method should only be called with the same ``pool`` instance that provided ``id``. :param id: the id .. method:: do_prepare() -> None Prepare the taskpool for accepting :func:`~gi.repository.Gst.TaskPool.push` operations. MT safe. .. method:: do_push(func: ~typing.Callable[[...], None], *user_data: ~typing.Any) -> None Start the execution of a new thread from ``pool``. :param func: the function to call :param user_data: data to pass to ``func`` Fields ------ .. rst-class:: interim-class .. class:: TaskPool :no-index: .. attribute:: object .. attribute:: pool