Portability | portable (depends on GHC) |
---|---|
Stability | alpha |
Maintainer | gtk2hs-devel@lists.sourceforge.net |
- data Cancellation
- cancellationNew :: IO Cancellation
- cancellationCancel :: Cancellation -> IO ()
- cancellationCheck :: Cancellation -> IO Bool
- cancellationAck :: Cancellation -> IO ()
- cancellationGetFD :: Cancellation -> IO Fd
Types
data Cancellation Source
An object that can be used for signalling cancellation of an operation.
Cancellation creation
:: IO Cancellation | a new |
Create a new Cancellation
object for reporting
cancellation to a gnome-vfs module.
Cancellation notification
:: Cancellation |
|
-> IO () |
Send a cancellation request through a Cancellation
object.
:: Cancellation |
|
-> IO Bool |
Check for pending cancellation.
:: Cancellation |
|
-> IO () |
Acknowledge a cancellation. This should be called if
cancellationCheck
returns True
.
Other Operations
:: Cancellation |
|
-> IO Fd | the file descriptor |
Get a file descriptor-based notificator for cancellation. When cancellation receives a cancellation request, a character will be made available on the returned file descriptor for input.
This is very useful for detecting cancellation during I/O operations: you can use the select() call to check for available input/output on the file you are reading/writing, and on the notificator's file descriptor at the same time. If a data is available on the notificator's file descriptor, you know you have to cancel the read/write operation.