-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Win32 network API
--   
--   Win32 network API
@package Win32-network
@version 0.1.0.0


-- | A shim layer for `Win32-network`'s <a>IOManager</a>
module System.IOManager
type WithIOManager = forall a. (IOManager -> IO a) -> IO a

-- | This is public api to interact with the io manager; On Windows
--   <a>IOManager</a> holds <a>associateWithIOCompletionPort</a>; on other
--   platforms <a>IOManager</a> can run over any type, and thus is
--   guaranteed to be no-op.
newtype IOManager
IOManager :: (forall hole. hole -> IO ()) -> IOManager
[associateWithIOManager] :: IOManager -> forall hole. hole -> IO ()
type IOManagerError = Void

-- | <a>withIOManager</a> allows to do asynchronous io on Windows hiding
--   the differences between posix and Win32.
--   
--   It starts an io manger thread, which should be only one running at a
--   time, so the best place to call it is very close to the <tt>main</tt>
--   function and last for duration of the application.
--   
--   Async <a>IO</a> operatitions which are using the <tt>iocp</tt> port
--   should not leak out-side of <a>withIOManager</a>. They will be
--   silently cancelled when <a>withIOManager</a> exists. In particular one
--   should not return <a>IOManager</a> from <a>withIOManager</a>.
withIOManager :: WithIOManager

-- | <i>Deprecated: Usage of type alias AssociateWithIOCP is deprecated,
--   use <a>IOManager</a> instead </i>
type AssociateWithIOCP = IOManager

-- | <i>Deprecated: Usage of <a>associateWithIOCP</a> is deprecated, use
--   <a>associateWithIOManager</a> instead.</i>
associateWithIOCP :: forall hole. IOManager -> hole -> IO ()
