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 |
A #GstPoll keeps track of file descriptors much like fd_set (used with select()) or a struct pollfd array (used with poll()). Once created with gst_poll_new(), the set can be used to wait for file descriptors to be readable and/or writable. It is possible to make this wait be controlled by specifying %TRUE for the @controllable flag when creating the set (or later calling gst_poll_set_controllable()).
New file descriptors are added to the set using gst_poll_add_fd(), and removed using gst_poll_remove_fd(). Controlling which file descriptors should be waited for to become readable and/or writable are done using gst_poll_fd_ctl_read() and gst_poll_fd_ctl_write().
Use gst_poll_wait() to wait for the file descriptors to actually become readable and/or writable, or to timeout if no file descriptor is available in time. The wait can be controlled by calling gst_poll_restart() and gst_poll_set_flushing().
Once the file descriptor set has been waited for, one can use gst_poll_fd_has_closed() to see if the file descriptor has been closed, gst_poll_fd_has_error() to see if it has generated an error, gst_poll_fd_can_read() to see if it is possible to read from the file descriptor, and gst_poll_fd_can_write() to see if it is possible to write to it.
- newtype Poll = Poll (ForeignPtr Poll)
- noPoll :: Maybe Poll
- data PollAddFdMethodInfo
- pollAddFd :: MonadIO m => Poll -> PollFD -> m Bool
- data PollFdCanReadMethodInfo
- pollFdCanRead :: MonadIO m => Poll -> PollFD -> m Bool
- data PollFdCanWriteMethodInfo
- pollFdCanWrite :: MonadIO m => Poll -> PollFD -> m Bool
- data PollFdCtlReadMethodInfo
- pollFdCtlRead :: MonadIO m => Poll -> PollFD -> Bool -> m Bool
- data PollFdCtlWriteMethodInfo
- pollFdCtlWrite :: MonadIO m => Poll -> PollFD -> Bool -> m Bool
- data PollFdHasClosedMethodInfo
- pollFdHasClosed :: MonadIO m => Poll -> PollFD -> m Bool
- data PollFdHasErrorMethodInfo
- pollFdHasError :: MonadIO m => Poll -> PollFD -> m Bool
- data PollFdIgnoredMethodInfo
- pollFdIgnored :: MonadIO m => Poll -> PollFD -> m ()
- data PollFreeMethodInfo
- pollFree :: MonadIO m => Poll -> m ()
- data PollGetReadGpollfdMethodInfo
- pollGetReadGpollfd :: MonadIO m => Poll -> PollFD -> m ()
- data PollReadControlMethodInfo
- pollReadControl :: MonadIO m => Poll -> m Bool
- data PollRemoveFdMethodInfo
- pollRemoveFd :: MonadIO m => Poll -> PollFD -> m Bool
- data PollRestartMethodInfo
- pollRestart :: MonadIO m => Poll -> m ()
- data PollSetControllableMethodInfo
- pollSetControllable :: MonadIO m => Poll -> Bool -> m Bool
- data PollSetFlushingMethodInfo
- pollSetFlushing :: MonadIO m => Poll -> Bool -> m ()
- data PollWaitMethodInfo
- pollWait :: MonadIO m => Poll -> Word64 -> m Int32
- data PollWriteControlMethodInfo
- pollWriteControl :: MonadIO m => Poll -> m Bool
Exported types
Methods
pollAddFd
pollFdCanRead
pollFdCanWrite
pollFdCtlRead
pollFdCtlWrite
pollFdHasClosed
pollFdHasError
pollFdIgnored
data PollFdIgnoredMethodInfo Source
((~) (TYPE Lifted) signature (PollFD -> m ()), MonadIO m) => MethodInfo (TYPE Lifted) PollFdIgnoredMethodInfo Poll signature Source | |
pollFdIgnored :: MonadIO m => Poll -> PollFD -> m () Source
pollFree
data PollFreeMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) PollFreeMethodInfo Poll signature Source | |
pollGetReadGpollfd
data PollGetReadGpollfdMethodInfo Source
((~) (TYPE Lifted) signature (PollFD -> m ()), MonadIO m) => MethodInfo (TYPE Lifted) PollGetReadGpollfdMethodInfo Poll signature Source | |
pollGetReadGpollfd :: MonadIO m => Poll -> PollFD -> m () Source
pollReadControl
data PollReadControlMethodInfo Source
((~) (TYPE Lifted) signature (m Bool), MonadIO m) => MethodInfo (TYPE Lifted) PollReadControlMethodInfo Poll signature Source | |
pollReadControl :: MonadIO m => Poll -> m Bool Source
pollRemoveFd
pollRestart
data PollRestartMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) PollRestartMethodInfo Poll signature Source | |
pollRestart :: MonadIO m => Poll -> m () Source
pollSetControllable
pollSetFlushing
data PollSetFlushingMethodInfo Source
((~) (TYPE Lifted) signature (Bool -> m ()), MonadIO m) => MethodInfo (TYPE Lifted) PollSetFlushingMethodInfo Poll signature Source | |
pollSetFlushing :: MonadIO m => Poll -> Bool -> m () Source
pollWait
data PollWaitMethodInfo Source
pollWriteControl
data PollWriteControlMethodInfo Source
((~) (TYPE Lifted) signature (m Bool), MonadIO m) => MethodInfo (TYPE Lifted) PollWriteControlMethodInfo Poll signature Source | |
pollWriteControl :: MonadIO m => Poll -> m Bool Source