Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2296

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>GHC.Event</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_GHC-Event.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">GHC.Event</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types
</a></li><li><a href="#g:2">Creation
</a></li><li><a href="#g:3">Running
</a><ul><li><a href="#g:4">Stepwise running
</a></li></ul></li><li><a href="#g:5">Registering interest in I/O events
</a></li><li><a href="#g:6">Registering interest in timeout events
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides scalable event notification for file
 descriptors and timeouts.
</p><p>This module should be considered GHC internal.
</p><ul><li>---------------------------------------------------------------------------
</li></ul></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:EventManager">EventManager</a> </li><li class="src short"><a href="#v:new">new</a> :: <a href="System-IO.html#t:IO">IO</a> <a href="GHC-Event.html#t:EventManager">EventManager</a></li><li class="src short"><a href="#v:getSystemEventManager">getSystemEventManager</a> :: <a href="System-IO.html#t:IO">IO</a> (<a href="Data-Maybe.html#t:Maybe">Maybe</a> <a href="GHC-Event.html#t:EventManager">EventManager</a>)</li><li class="src short"><a href="#v:loop">loop</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:step">step</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; TimeoutQueue -&gt; <a href="System-IO.html#t:IO">IO</a> (<a href="Data-Bool.html#t:Bool">Bool</a>, TimeoutQueue)</li><li class="src short"><a href="#v:shutdown">shutdown</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:Event">Event</a> </li><li class="src short"><a href="#v:evtRead">evtRead</a> :: <a href="GHC-Event.html#t:Event">Event</a></li><li class="src short"><a href="#v:evtWrite">evtWrite</a> :: <a href="GHC-Event.html#t:Event">Event</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:IOCallback">IOCallback</a> = <a href="GHC-Event.html#t:FdKey">FdKey</a> -&gt; <a href="GHC-Event.html#t:Event">Event</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:FdKey">FdKey</a> </li><li class="src short"><a href="#v:registerFd">registerFd</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:IOCallback">IOCallback</a> -&gt; <a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="GHC-Event.html#t:Event">Event</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-Event.html#t:FdKey">FdKey</a></li><li class="src short"><a href="#v:registerFd_">registerFd_</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:IOCallback">IOCallback</a> -&gt; <a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="GHC-Event.html#t:Event">Event</a> -&gt; <a href="System-IO.html#t:IO">IO</a> (<a href="GHC-Event.html#t:FdKey">FdKey</a>, <a href="Data-Bool.html#t:Bool">Bool</a>)</li><li class="src short"><a href="#v:unregisterFd">unregisterFd</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:FdKey">FdKey</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:unregisterFd_">unregisterFd_</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:FdKey">FdKey</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:closeFd">closeFd</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; (<a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a>) -&gt; <a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:TimeoutCallback">TimeoutCallback</a> = <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:TimeoutKey">TimeoutKey</a> </li><li class="src short"><a href="#v:registerTimeout">registerTimeout</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="Data-Int.html#t:Int">Int</a> -&gt; <a href="GHC-Event.html#t:TimeoutCallback">TimeoutCallback</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a></li><li class="src short"><a href="#v:updateTimeout">updateTimeout</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a> -&gt; <a href="Data-Int.html#t:Int">Int</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:unregisterTimeout">unregisterTimeout</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li></ul></div><div id="interface"><h1 id="g:1">Types
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:EventManager" class="def">EventManager</a>  </p><div class="doc"><p>The event manager state.
</p></div></div><h1 id="g:2">Creation
</h1><div class="top"><p class="src"><a name="v:new" class="def">new</a> :: <a href="System-IO.html#t:IO">IO</a> <a href="GHC-Event.html#t:EventManager">EventManager</a></p><div class="doc"><p>Create a new event manager.
</p></div></div><div class="top"><p class="src"><a name="v:getSystemEventManager" class="def">getSystemEventManager</a> :: <a href="System-IO.html#t:IO">IO</a> (<a href="Data-Maybe.html#t:Maybe">Maybe</a> <a href="GHC-Event.html#t:EventManager">EventManager</a>)</p><div class="doc"><p>Retrieve the system event manager.
</p><p>This function always returns <code><a href="Data-Maybe.html#v:Just">Just</a></code> the system event manager when using the
 threaded RTS and <code><a href="Data-Maybe.html#v:Nothing">Nothing</a></code> otherwise.
</p></div></div><h1 id="g:3">Running
</h1><div class="top"><p class="src"><a name="v:loop" class="def">loop</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Start handling events.  This function loops until told to stop,
 using <code><a href="GHC-Event.html#v:shutdown">shutdown</a></code>.
</p><p><em>Note</em>: This loop can only be run once per <code><a href="GHC-Event.html#t:EventManager">EventManager</a></code>, as it
 closes all of its control resources when it finishes.
</p></div></div><h2 id="g:4">Stepwise running
</h2><div class="top"><p class="src"><a name="v:step" class="def">step</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; TimeoutQueue -&gt; <a href="System-IO.html#t:IO">IO</a> (<a href="Data-Bool.html#t:Bool">Bool</a>, TimeoutQueue)</p></div><div class="top"><p class="src"><a name="v:shutdown" class="def">shutdown</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Asynchronously shuts down the event manager, if running.
</p></div></div><h1 id="g:5">Registering interest in I/O events
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Event" class="def">Event</a>  </p><div class="doc"><p>An I/O event.
</p></div><div class="subs instances"><p id="control.i:Event" class="caption collapser" onclick="toggleSection('i:Event')">Instances</p><div id="section.i:Event" class="show"><table><tr><td class="src"><a href="Data-Eq.html#t:Eq">Eq</a> <a href="GHC-Event.html#t:Event">Event</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-Show.html#t:Show">Show</a> <a href="GHC-Event.html#t:Event">Event</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Monoid.html#t:Monoid">Monoid</a> <a href="GHC-Event.html#t:Event">Event</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:evtRead" class="def">evtRead</a> :: <a href="GHC-Event.html#t:Event">Event</a></p><div class="doc"><p>Data is available to be read.
</p></div></div><div class="top"><p class="src"><a name="v:evtWrite" class="def">evtWrite</a> :: <a href="GHC-Event.html#t:Event">Event</a></p><div class="doc"><p>The file descriptor is ready to accept a write.
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:IOCallback" class="def">IOCallback</a> = <a href="GHC-Event.html#t:FdKey">FdKey</a> -&gt; <a href="GHC-Event.html#t:Event">Event</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Callback invoked on I/O events.
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:FdKey" class="def">FdKey</a>  </p><div class="doc"><p>A file descriptor registration cookie.
</p></div><div class="subs instances"><p id="control.i:FdKey" class="caption collapser" onclick="toggleSection('i:FdKey')">Instances</p><div id="section.i:FdKey" class="show"><table><tr><td class="src"><a href="Data-Eq.html#t:Eq">Eq</a> <a href="GHC-Event.html#t:FdKey">FdKey</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-Show.html#t:Show">Show</a> <a href="GHC-Event.html#t:FdKey">FdKey</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:registerFd" class="def">registerFd</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:IOCallback">IOCallback</a> -&gt; <a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="GHC-Event.html#t:Event">Event</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-Event.html#t:FdKey">FdKey</a></p><div class="doc"><p><code>registerFd mgr cb fd evs</code> registers interest in the events <code>evs</code>
 on the file descriptor <code>fd</code>.  <code>cb</code> is called for each event that
 occurs.  Returns a cookie that can be handed to <code><a href="GHC-Event.html#v:unregisterFd">unregisterFd</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:registerFd_" class="def">registerFd_</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:IOCallback">IOCallback</a> -&gt; <a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="GHC-Event.html#t:Event">Event</a> -&gt; <a href="System-IO.html#t:IO">IO</a> (<a href="GHC-Event.html#t:FdKey">FdKey</a>, <a href="Data-Bool.html#t:Bool">Bool</a>)</p><div class="doc"><p>Register interest in the given events, without waking the event
 manager thread.  The <code><a href="Data-Bool.html#t:Bool">Bool</a></code> return value indicates whether the
 event manager ought to be woken.
</p></div></div><div class="top"><p class="src"><a name="v:unregisterFd" class="def">unregisterFd</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:FdKey">FdKey</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Drop a previous file descriptor registration.
</p></div></div><div class="top"><p class="src"><a name="v:unregisterFd_" class="def">unregisterFd_</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:FdKey">FdKey</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Drop a previous file descriptor registration, without waking the
 event manager thread.  The return value indicates whether the event
 manager ought to be woken.
</p></div></div><div class="top"><p class="src"><a name="v:closeFd" class="def">closeFd</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; (<a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a>) -&gt; <a href="System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Close a file descriptor in a race-safe way.
</p></div></div><h1 id="g:6">Registering interest in timeout events
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:TimeoutCallback" class="def">TimeoutCallback</a> = <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Callback invoked on timeout events.
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:TimeoutKey" class="def">TimeoutKey</a>  </p><div class="doc"><p>A timeout registration cookie.
</p></div><div class="subs instances"><p id="control.i:TimeoutKey" class="caption collapser" onclick="toggleSection('i:TimeoutKey')">Instances</p><div id="section.i:TimeoutKey" class="show"><table><tr><td class="src"><a href="Data-Eq.html#t:Eq">Eq</a> <a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:registerTimeout" class="def">registerTimeout</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="Data-Int.html#t:Int">Int</a> -&gt; <a href="GHC-Event.html#t:TimeoutCallback">TimeoutCallback</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a></p><div class="doc"><p>Register a timeout in the given number of microseconds.  The
 returned <code><a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a></code> can be used to later unregister or update the
 timeout.  The timeout is automatically unregistered after the given
 time has passed.
</p></div></div><div class="top"><p class="src"><a name="v:updateTimeout" class="def">updateTimeout</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a> -&gt; <a href="Data-Int.html#t:Int">Int</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Update an active timeout to fire in the given number of
 microseconds.
</p></div></div><div class="top"><p class="src"><a name="v:unregisterTimeout" class="def">unregisterTimeout</a> :: <a href="GHC-Event.html#t:EventManager">EventManager</a> -&gt; <a href="GHC-Event.html#t:TimeoutKey">TimeoutKey</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Unregister an active timeout.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>