gi-gst-1.0.26: GStreamer bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gst.Objects.TaskPool

Description

This object provides an abstraction for creating threads. The default implementation uses a regular GThreadPool to start tasks.

Subclasses can be made to create custom threads.

Synopsis

Exported types

newtype TaskPool Source #

Memory-managed wrapper type.

Constructors

TaskPool (ManagedPtr TaskPool) 

Instances

Instances details
Eq TaskPool Source # 
Instance details

Defined in GI.Gst.Objects.TaskPool

GObject TaskPool Source # 
Instance details

Defined in GI.Gst.Objects.TaskPool

ManagedPtrNewtype TaskPool Source # 
Instance details

Defined in GI.Gst.Objects.TaskPool

Methods

toManagedPtr :: TaskPool -> ManagedPtr TaskPool

TypedObject TaskPool Source # 
Instance details

Defined in GI.Gst.Objects.TaskPool

Methods

glibType :: IO GType

HasParentTypes TaskPool Source # 
Instance details

Defined in GI.Gst.Objects.TaskPool

IsGValue (Maybe TaskPool) Source #

Convert TaskPool to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gst.Objects.TaskPool

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe TaskPool -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe TaskPool)

type ParentTypes TaskPool Source # 
Instance details

Defined in GI.Gst.Objects.TaskPool

type ParentTypes TaskPool = '[Object, Object]

class (GObject o, IsDescendantOf TaskPool o) => IsTaskPool o Source #

Type class for types which can be safely cast to TaskPool, for instance with toTaskPool.

Instances

Instances details
(GObject o, IsDescendantOf TaskPool o) => IsTaskPool o Source # 
Instance details

Defined in GI.Gst.Objects.TaskPool

toTaskPool :: (MonadIO m, IsTaskPool o) => o -> m TaskPool Source #

Cast to TaskPool, for types for which this is known to be safe. For general casts, use castTo.

Methods

cleanup

taskPoolCleanup Source #

Arguments

:: (HasCallStack, MonadIO m, IsTaskPool a) 
=> a

pool: a TaskPool

-> m () 

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.

disposeHandle

taskPoolDisposeHandle Source #

Arguments

:: (HasCallStack, MonadIO m, IsTaskPool a) 
=> a

pool: a TaskPool

-> Ptr ()

id: the id

-> m () 

Dispose of the handle returned by taskPoolPush. This does not need to be called with the default implementation as the default TaskPoolClass::push implementation always returns Nothing. This does not need to be called either when calling taskPoolJoin, but should be called when joining is not necessary, but taskPoolPush returned a non-Nothing value.

This method should only be called with the same pool instance that provided id.

Since: 1.20

join

taskPoolJoin Source #

Arguments

:: (HasCallStack, MonadIO m, IsTaskPool a) 
=> a

pool: a TaskPool

-> Ptr ()

id: the id

-> m () 

Join a task and/or return it to the pool. id is the id obtained from taskPoolPush. The default implementation does nothing, as the default TaskPoolClass::push implementation always returns Nothing.

This method should only be called with the same pool instance that provided id.

new

taskPoolNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m TaskPool

Returns: a new TaskPool. objectUnref after usage.

Create a new default task pool. The default task pool will use a regular GThreadPool for threads.

prepare

taskPoolPrepare Source #

Arguments

:: (HasCallStack, MonadIO m, IsTaskPool a) 
=> a

pool: a TaskPool

-> m ()

(Can throw GError)

Prepare the taskpool for accepting taskPoolPush operations.

MT safe.

push

taskPoolPush Source #

Arguments

:: (HasCallStack, MonadIO m, IsTaskPool a) 
=> a

pool: a TaskPool

-> TaskPoolFunction

func: the function to call

-> m (Ptr ())

Returns: a pointer that should be used for the gst_task_pool_join function. This pointer can be Nothing, you must check error to detect errors. If the pointer is not Nothing and taskPoolJoin is not used, call taskPoolDisposeHandle instead. (Can throw GError)

Start the execution of a new thread from pool.