/usr/share/doc/racket/reference/plumbers.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>14.11 Plumbers</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-weight: bold">The Racket Reference</span></a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2 </td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3 </td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4 </td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5 </td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6 </td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7 </td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8 </td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9 </td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10 </td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11 </td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12 </td><td><a href="Macros.html" class="tocviewlink" data-pltdoc="x">Macros</a></td></tr><tr><td align="right">13 </td><td><a href="input-and-output.html" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr><tr><td align="right">14 </td><td><a href="security.html" class="tocviewselflink" data-pltdoc="x">Reflection and Security</a></td></tr><tr><td align="right">15 </td><td><a href="os.html" class="tocviewlink" data-pltdoc="x">Operating System</a></td></tr><tr><td align="right">16 </td><td><a href="memory.html" class="tocviewlink" data-pltdoc="x">Memory Management</a></td></tr><tr><td align="right">17 </td><td><a href="unsafe.html" class="tocviewlink" data-pltdoc="x">Unsafe Operations</a></td></tr><tr><td align="right">18 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running Racket</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>14 </td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">14.1 </td><td><a href="Namespaces.html" class="tocviewlink" data-pltdoc="x">Namespaces</a></td></tr><tr><td align="right">14.2 </td><td><a href="eval.html" class="tocviewlink" data-pltdoc="x">Evaluation and Compilation</a></td></tr><tr><td align="right">14.3 </td><td><a href="load-lang.html" class="tocviewlink" data-pltdoc="x">The <span class="RktModLink"><span class="RktSym">racket/<span class="mywbr"> </span>load</span></span> Language</a></td></tr><tr><td align="right">14.4 </td><td><a href="Module_Names_and_Loading.html" class="tocviewlink" data-pltdoc="x">Module Names and Loading</a></td></tr><tr><td align="right">14.5 </td><td><a href="chaperones.html" class="tocviewlink" data-pltdoc="x">Impersonators and Chaperones</a></td></tr><tr><td align="right">14.6 </td><td><a href="securityguards.html" class="tocviewlink" data-pltdoc="x">Security Guards</a></td></tr><tr><td align="right">14.7 </td><td><a href="custodians.html" class="tocviewlink" data-pltdoc="x">Custodians</a></td></tr><tr><td align="right">14.8 </td><td><a href="threadgroups.html" class="tocviewlink" data-pltdoc="x">Thread Groups</a></td></tr><tr><td align="right">14.9 </td><td><a href="inspectors.html" class="tocviewlink" data-pltdoc="x">Structure Inspectors</a></td></tr><tr><td align="right">14.10 </td><td><a href="modprotect.html" class="tocviewlink" data-pltdoc="x">Code Inspectors</a></td></tr><tr><td align="right">14.11 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Plumbers</a></td></tr><tr><td align="right">14.12 </td><td><a href="Sandboxed_Evaluation.html" class="tocviewlink" data-pltdoc="x">Sandboxed Evaluation</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._plumber~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">plumber?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._make-plumber%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>plumber</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._current-plumber%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">current-<wbr></wbr>plumber</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-all%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">plumber-<wbr></wbr>flush-<wbr></wbr>all</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">plumber-<wbr></wbr>flush-<wbr></wbr>handle?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-add-flush%21%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">plumber-<wbr></wbr>add-<wbr></wbr>flush!</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle-remove%21%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">plumber-<wbr></wbr>flush-<wbr></wbr>handle-<wbr></wbr>remove!</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="modprotect.html" title="backward to "14.10 Code Inspectors"" data-pltdoc="x">← prev</a> <a href="security.html" title="up to "14 Reflection and Security"" data-pltdoc="x">up</a> <a href="Sandboxed_Evaluation.html" title="forward to "14.12 Sandboxed Evaluation"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-part-tag=""plumbers"">14.11<tt> </tt><a name="(part._plumbers)"></a>Plumbers</h4><p><div class="SIntrapara">A <a name="(tech._plumber)"></a><span style="font-style: italic">plumber</span> supports <a name="(tech._flush._callback)"></a><span style="font-style: italic">flush callbacks</span>, which are
normally triggered just before a Racket process or <a href="places.html#%28tech._place%29" class="techoutside" data-pltdoc="x"><span class="techinside">place</span></a> exits.
For example, a <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a> might flush an output port’s
buffer.</div><div class="SIntrapara"><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">Flush callbacks</span></a> are roughly analogous to the standard C
library’s <a name="(idx._(gentag._244._(lib._scribblings/reference/reference..scrbl)))"></a><span class="stt">atexit</span>, but flush callback can also be used in other,
similar scenarios.</p></blockquote></blockquote></blockquote></div></p><p>There is no guarantee that a flush callback will be called before a
process terminates—<wbr></wbr>either because the plumber is not the original
plumber that is flushed by the default <a href="Exiting.html#%28tech._exit._handler%29" class="techoutside" data-pltdoc="x"><span class="techinside">exit handler</span></a>, or because
the process is terminated forcibly (e.g., through a custodian
shutdown).</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._plumber~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">plumber?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a <a href="#%28tech._plumber%29" class="techoutside" data-pltdoc="x"><span class="techinside">plumber</span></a> value,
<span class="RktVal">#f</span> otherwise.</div></p><p class="SHistory">Added in version 6.0.1.8 of package <span class="stt">base</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._make-plumber))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._make-plumber%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-plumber</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym">pluber?</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Creates a new <a href="#%28tech._plumber%29" class="techoutside" data-pltdoc="x"><span class="techinside">plumber</span></a>.</div></p><p>Plumbers have no hierarchy (unlike <a href="eval-model.html#%28tech._custodian%29" class="techoutside" data-pltdoc="x"><span class="techinside">custodians</span></a> or
<a href="inspectors.html#%28tech._inspector%29" class="techoutside" data-pltdoc="x"><span class="techinside">inspectors</span></a>), but a <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a> can be registered in
one plumber to call <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-all%29%29" class="RktValLink" data-pltdoc="x">plumber-flush-all</a></span> with another plumber.</p><p class="SHistory">Added in version 6.0.1.8 of package <span class="stt">base</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._current-plumber))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-plumber%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-plumber</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber~3f%29%29" class="RktValLink" data-pltdoc="x">plumber?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._current-plumber%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-plumber</a></span></span><span class="hspace"> </span><span class="RktVar">plumber</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">plumber</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber~3f%29%29" class="RktValLink" data-pltdoc="x">plumber?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A <a href="eval-model.html#%28tech._parameter%29" class="techoutside" data-pltdoc="x"><span class="techinside">parameter</span></a> that determines a <a name="(tech._current._plumber)"></a><span style="font-style: italic">current plumber</span> for
<a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callbacks</span></a>. For example, creating an output <a href="file-ports.html#%28tech._file._stream._port%29" class="techoutside" data-pltdoc="x"><span class="techinside">file
stream port</span></a> registers a <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a> with the <a href="#%28tech._current._plumber%29" class="techoutside" data-pltdoc="x"><span class="techinside">current
plumber</span></a> to flush the port as long as the port is opened.</div></p><p class="SHistory">Added in version 6.0.1.8 of package <span class="stt">base</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._plumber-flush-all))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-all%29%29" class="RktValDef RktValLink" data-pltdoc="x">plumber-flush-all</a></span></span><span class="hspace"> </span><span class="RktVar">plumber</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">plumber</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber~3f%29%29" class="RktValLink" data-pltdoc="x">plumber?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Calls all <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callbacks</span></a> that are registered with <span class="RktVar">plumber</span>.</div></p><p>The <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callbacks</span></a> to call are collected from <span class="RktVar">plumber</span>
before the first one is called. If a <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a> registers a
new <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a>, the new one is <span style="font-style: italic">not</span> called. If a
<a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a> raises an exception or otherwise escapes, then
the remaining <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callbacks</span></a> are not called.</p><p class="SHistory">Added in version 6.0.1.8 of package <span class="stt">base</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._plumber-flush-handle~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">plumber-flush-handle?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a <a name="(tech._flush._handle)"></a><span style="font-style: italic">flush handle</span>
represents the registration of a <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a>, <span class="RktVal">#f</span>
otherwise.</div></p><p class="SHistory">Added in version 6.0.1.8 of package <span class="stt">base</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._plumber-add-flush!))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-add-flush%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">plumber-add-flush!</a></span></span><span class="hspace"> </span><span class="RktVar">plumber</span><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>[<span class="RktVar">weak?</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle~3f%29%29" class="RktValLink" data-pltdoc="x">plumber-flush-handle?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">plumber</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber~3f%29%29" class="RktValLink" data-pltdoc="x">plumber?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle~3f%29%29" class="RktValLink" data-pltdoc="x">plumber-flush-handle?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">weak?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Registers <span class="RktVar">proc</span> as a <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a> with <span class="RktVar">plumber</span>, so
that <span class="RktVar">proc</span> is called when <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-all%29%29" class="RktValLink" data-pltdoc="x">plumber-flush-all</a></span> is
applied to <span class="RktVar">plumber</span>.</div></p><p>The result <a href="#%28tech._flush._handle%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush handle</span></a> represents the registration of the
callback, and it can be used with <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle-remove%21%29%29" class="RktValLink" data-pltdoc="x">plumber-flush-handle-remove!</a></span> to
unregister the callback.</p><p>The given <span class="RktVar">proc</span> is reachable from the <a href="#%28tech._flush._handle%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush handle</span></a>, but
if <span class="RktVar">weak?</span> is true, then <span class="RktVar">plumber</span> retains only a
<a href="eval-model.html#%28tech._weak._reference%29" class="techoutside" data-pltdoc="x"><span class="techinside">weak reference</span></a> to the result <a href="#%28tech._flush._handle%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush handle</span></a> (and
thus <span class="RktVar">proc</span>).</p><p>When <span class="RktVar">proc</span> is called as a <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a>, it is passed
the same value that is returned by <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-add-flush%21%29%29" class="RktValLink" data-pltdoc="x">plumber-add-flush!</a></span> so
that <span class="RktVar">proc</span> can conveniently unregister itself. The call of
<span class="RktVar">proc</span> is within a <a href="eval-model.html#%28tech._continuation._barrier%29" class="techoutside" data-pltdoc="x"><span class="techinside">continuation barrier</span></a>.</p><p class="SHistory">Added in version 6.0.1.8 of package <span class="stt">base</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._plumber-flush-handle-remove!))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle-remove%21%29%29" class="RktValDef RktValLink" data-pltdoc="x">plumber-flush-handle-remove!</a></span></span><span class="hspace"> </span><span class="RktVar">handle</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">handle</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle~3f%29%29" class="RktValLink" data-pltdoc="x">plumber-flush-handle?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Unregisters the <a href="#%28tech._flush._callback%29" class="techoutside" data-pltdoc="x"><span class="techinside">flush callback</span></a> that was registered by the
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-add-flush%21%29%29" class="RktValLink" data-pltdoc="x">plumber-add-flush!</a></span> call that produced <span class="RktVar">handle</span>.</div></p><p>If the registration represented by <span class="RktVar">handle</span> has been removed already,
then <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._plumber-flush-handle-remove%21%29%29" class="RktValLink" data-pltdoc="x">plumber-flush-handle-remove!</a></span> has no effect.</p><p class="SHistory">Added in version 6.0.1.8 of package <span class="stt">base</span>.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="modprotect.html" title="backward to "14.10 Code Inspectors"" data-pltdoc="x">← prev</a> <a href="security.html" title="up to "14 Reflection and Security"" data-pltdoc="x">up</a> <a href="Sandboxed_Evaluation.html" title="forward to "14.12 Sandboxed Evaluation"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|