Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Opaque class for defining and scheduling IO jobs.
- newtype IOSchedulerJob = IOSchedulerJob (ManagedPtr IOSchedulerJob)
- noIOSchedulerJob :: Maybe IOSchedulerJob
- data IOSchedulerJobSendToMainloopMethodInfo
- iOSchedulerJobSendToMainloop :: (HasCallStack, MonadIO m) => IOSchedulerJob -> SourceFunc -> m Bool
- data IOSchedulerJobSendToMainloopAsyncMethodInfo
- iOSchedulerJobSendToMainloopAsync :: (HasCallStack, MonadIO m) => IOSchedulerJob -> SourceFunc -> m ()
Exported types
newtype IOSchedulerJob Source #
WrappedPtr IOSchedulerJob Source # | |
((~) * info (ResolveIOSchedulerJobMethod t IOSchedulerJob), MethodInfo * info IOSchedulerJob p) => IsLabel t (IOSchedulerJob -> p) Source # | |
((~) * info (ResolveIOSchedulerJobMethod t IOSchedulerJob), MethodInfo * info IOSchedulerJob p) => IsLabelProxy t (IOSchedulerJob -> p) Source # | |
HasAttributeList * IOSchedulerJob Source # | |
((~) * signature (SourceFunc -> m ()), MonadIO m) => MethodInfo * IOSchedulerJobSendToMainloopAsyncMethodInfo IOSchedulerJob signature Source # | |
((~) * signature (SourceFunc -> m Bool), MonadIO m) => MethodInfo * IOSchedulerJobSendToMainloopMethodInfo IOSchedulerJob signature Source # | |
type AttributeList IOSchedulerJob Source # | |
Methods
sendToMainloop
data IOSchedulerJobSendToMainloopMethodInfo Source #
((~) * signature (SourceFunc -> m Bool), MonadIO m) => MethodInfo * IOSchedulerJobSendToMainloopMethodInfo IOSchedulerJob signature Source # | |
iOSchedulerJobSendToMainloop Source #
:: (HasCallStack, MonadIO m) | |
=> IOSchedulerJob |
|
-> SourceFunc |
|
-> m Bool | Returns: The return value of |
Deprecated: Use g_main_context_invoke()
.
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).
sendToMainloopAsync
data IOSchedulerJobSendToMainloopAsyncMethodInfo Source #
((~) * signature (SourceFunc -> m ()), MonadIO m) => MethodInfo * IOSchedulerJobSendToMainloopAsyncMethodInfo IOSchedulerJob signature Source # | |
iOSchedulerJobSendToMainloopAsync Source #
:: (HasCallStack, MonadIO m) | |
=> IOSchedulerJob |
|
-> SourceFunc |
|
-> m () |
Deprecated: Use g_main_context_invoke()
.
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 userData
from ioSchedulerPushJob
on to this function you have to ensure that it is not freed before
func
is called, either by passing Nothing
as notify
to
ioSchedulerPushJob
or by using refcounting for userData
.