Gtk2HsContentsIndex
System.Gnome.VFS.Cancellation
Maintainergtk2hs-devel@lists.sourceforge.net Stability : alpha Portability : portable (depends on GHC)
Contents
Types
Cancellation creation
Cancellation notification
Other Operations
Description
Synopsis
data Cancellation
cancellationNew :: IO Cancellation
cancellationCancel :: Cancellation -> IO ()
cancellationCheck :: Cancellation -> IO Bool
cancellationAck :: Cancellation -> IO ()
cancellationGetFD :: Cancellation -> IO Fd
Types
data Cancellation
An object that can be used for signalling cancellation of an operation.
Cancellation creation
cancellationNew
:: IO Cancellationa new Cancellation object
Create a new Cancellation object for reporting cancellation to a gnome-vfs module.
Cancellation notification
cancellationCancel
:: Cancellationcancellation - the object to request cancellation through
-> IO ()
Send a cancellation request through a Cancellation object.
cancellationCheck
:: Cancellationcancellation - the object to check for cancellation
-> IO BoolTrue if cancellation has been requested, False otherwise
Check for pending cancellation.
cancellationAck
:: Cancellationcancellation - the object to achnowledge cancellation
-> IO ()
Acknowledge a cancellation. This should be called if cancellationCheck returns True.
Other Operations
cancellationGetFD
:: Cancellationcancellation - the object to get a file descriptor for
-> IO Fdthe 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.

Produced by Haddock version 0.8