Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A shim layer for `Win32-network`'s
IOManager
Synopsis
- type WithIOManager = forall a. ( IOManager -> IO a) -> IO a
-
newtype
IOManager
=
IOManager
{
- associateWithIOManager :: forall hole. hole -> IO ()
- type IOManagerError = Void
- withIOManager :: WithIOManager
- type AssociateWithIOCP = IOManager
- associateWithIOCP :: forall hole. IOManager -> hole -> IO ()
Documentation
This is public api to interact with the io manager; On Windows
IOManager
holds
associateWithIOCompletionPort
;
on other platforms
IOManager
can run over any type, and thus is
guaranteed to be no-op.
IOManager | |
|
type IOManagerError = Void Source #
withIOManager :: WithIOManager Source #
withIOManager
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
main
function and last for
duration of the application.
Async
IO
operations which are using the
iocp
port should not leak
out-side of
withIOManager
. They will be silently cancelled when
withIOManager
exists. In particular one should not return
IOManager
from
withIOManager
.
Deprecated API
type AssociateWithIOCP = IOManager Source #
Deprecated: Usage of type alias AssociateWithIOCP is deprecated, use
IOManager
instead
associateWithIOCP :: forall hole. IOManager -> hole -> IO () Source #
Deprecated: Usage of
associateWithIOCP
is deprecated, use
associateWithIOManager
instead.