guile-knots/index.html
Automatic website updater c48e0c9dc7 Automatic website update
2026-03-23 11:57:27 +00:00

2269 lines
123 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Guile Knots</title>
<meta name="description" content="Guile Knots">
<meta name="keywords" content="Guile Knots">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content=".texi2any-real">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="#Top" rel="start" title="Top">
<link href="#Concept-Index" rel="index" title="Concept Index">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<link href="#API" rel="next" title="API">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
a.summary-letter-printindex {text-decoration: none}
div.example {margin-left: 3.2em}
h1.settitle {text-align:center}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
td.printindex-index-entry {vertical-align: top}
td.printindex-index-section {vertical-align: top; padding-left: 1em}
th.entries-header-printindex {text-align:left}
th.sections-header-printindex {text-align:left; padding-left: 1em}
ul.mark-bullet {list-style-type: disc}
ul.toc-numbered-mark {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="https://luis-felipe.gitlab.io/texinfo-css/static/css/texinfo-7.css">
</head>
<body lang="en">
<h1 class="settitle">Guile Knots</h1>
<hr>
<div class="top-level-extent" id="Top">
<div class="nav-panel">
<p>
Next: <a href="#API" accesskey="n" rel="next">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h1 class="top" id="Overview"><span>Overview<a class="copiable-link" href="#Overview"> &para;</a></span></h1>
<p>Guile Knots is a library providing tools and patterns for programming
with <a class="url" href="https://github.com/wingo/fibers">Guile Fibers</a>. Guile Knots
provides higher level building blocks for writing programs using Guile
Fibers, including managing code that can&rsquo;t run in a thread used by
fibers. Also included is a web server implementation using Fibers,
which while being similar to the web server provided by Fibers, can
provide some benefits in specific circumstances.
</p>
<div class="element-contents" id="SEC_Contents">
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="toc-numbered-mark">
<li><a id="toc-API-1" href="#API">1 API</a>
<ul class="toc-numbered-mark">
<li><a id="toc-_0028knots_0029" href="#knots">1.1 (knots)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Procedures" href="#Procedures">1.1.1 Procedures</a></li>
<li><a id="toc-Record-Types" href="#Record-Types">1.1.2 Record Types</a></li>
</ul></li>
<li><a id="toc-_0028knots-backtraces_0029" href="#knots_005fbacktraces">1.2 (knots backtraces)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Procedures-1" href="#Procedures-1">1.2.1 Procedures</a></li>
<li><a id="toc-Record-Types-1" href="#Record-Types-1">1.2.2 Record Types</a></li>
</ul></li>
<li><a id="toc-_0028knots-non_002dblocking_0029" href="#knots_005fnon_002dblocking">1.3 (knots non-blocking)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Procedures-2" href="#Procedures-2">1.3.1 Procedures</a></li>
</ul></li>
<li><a id="toc-_0028knots-parallelism_0029" href="#knots_005fparallelism">1.4 (knots parallelism)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Macros" href="#Macros">1.4.1 Macros</a></li>
<li><a id="toc-Procedures-3" href="#Procedures-3">1.4.2 Procedures</a></li>
</ul></li>
<li><a id="toc-_0028knots-promise_0029" href="#knots_005fpromise">1.5 (knots promise)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Macros-1" href="#Macros-1">1.5.1 Macros</a></li>
<li><a id="toc-Procedures-4" href="#Procedures-4">1.5.2 Procedures</a></li>
</ul></li>
<li><a id="toc-_0028knots-queue_0029" href="#knots_005fqueue">1.6 (knots queue)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Procedures-5" href="#Procedures-5">1.6.1 Procedures</a></li>
</ul></li>
<li><a id="toc-_0028knots-resource_002dpool_0029" href="#knots_005fresource_002dpool">1.7 (knots resource-pool)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Macros-2" href="#Macros-2">1.7.1 Macros</a></li>
<li><a id="toc-Parameters" href="#Parameters">1.7.2 Parameters</a></li>
<li><a id="toc-Procedures-6" href="#Procedures-6">1.7.3 Procedures</a></li>
<li><a id="toc-Record-Types-2" href="#Record-Types-2">1.7.4 Record Types</a></li>
</ul></li>
<li><a id="toc-_0028knots-sort_0029" href="#knots_005fsort">1.8 (knots sort)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Procedures-7" href="#Procedures-7">1.8.1 Procedures</a></li>
</ul></li>
<li><a id="toc-_0028knots-thread_002dpool_0029" href="#knots_005fthread_002dpool">1.9 (knots thread-pool)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Macros-3" href="#Macros-3">1.9.1 Macros</a></li>
<li><a id="toc-Procedures-8" href="#Procedures-8">1.9.2 Procedures</a></li>
<li><a id="toc-Record-Types-3" href="#Record-Types-3">1.9.3 Record Types</a></li>
</ul></li>
<li><a id="toc-_0028knots-timeout_0029" href="#knots_005ftimeout">1.10 (knots timeout)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Procedures-9" href="#Procedures-9">1.10.1 Procedures</a></li>
<li><a id="toc-Record-Types-4" href="#Record-Types-4">1.10.2 Record Types</a></li>
</ul></li>
<li><a id="toc-_0028knots-web_002dserver_0029" href="#knots_005fweb_002dserver">1.11 (knots web-server)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Macros-4" href="#Macros-4">1.11.1 Macros</a></li>
<li><a id="toc-Procedures-10" href="#Procedures-10">1.11.2 Procedures</a></li>
<li><a id="toc-Record-Types-5" href="#Record-Types-5">1.11.3 Record Types</a></li>
</ul></li>
<li><a id="toc-_0028knots-web_0029" href="#knots_005fweb">1.12 (knots web)</a>
<ul class="toc-numbered-mark">
<li><a id="toc-Procedures-11" href="#Procedures-11">1.12.1 Procedures</a></li>
</ul></li>
</ul></li>
<li><a id="toc-Version-History-1" href="#Version-History">Appendix A Version History</a></li>
<li><a id="toc-Copying-Information-1" href="#Copying-Information">Appendix B Copying Information</a></li>
<li><a id="toc-Concept-Index-1" href="#Concept-Index" rel="index">Concept Index</a></li>
<li><a id="toc-Data-Type-Index-1" href="#Data-Type-Index" rel="index">Data Type Index</a></li>
<li><a id="toc-Procedure-Index-1" href="#Procedure-Index" rel="index">Procedure Index</a></li>
<li><a id="toc-Variable-Index-1" href="#Variable-Index" rel="index">Variable Index</a></li>
</ul>
</div>
</div>
<hr>
<div class="chapter-level-extent" id="API">
<div class="nav-panel">
<p>
Next: <a href="#Version-History" accesskey="n" rel="next">Version History</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Overview</a>, Up: <a href="#Top" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h2 class="chapter" id="API-1"><span>1 API<a class="copiable-link" href="#API-1"> &para;</a></span></h2>
<p>The following is the list of modules provided by this library.
</p>
<ul class="mini-toc">
<li><a href="#knots" accesskey="1">(knots)</a></li>
<li><a href="#knots_005fbacktraces" accesskey="2">(knots backtraces)</a></li>
<li><a href="#knots_005fnon_002dblocking" accesskey="3">(knots non-blocking)</a></li>
<li><a href="#knots_005fparallelism" accesskey="4">(knots parallelism)</a></li>
<li><a href="#knots_005fpromise" accesskey="5">(knots promise)</a></li>
<li><a href="#knots_005fqueue" accesskey="6">(knots queue)</a></li>
<li><a href="#knots_005fresource_002dpool" accesskey="7">(knots resource-pool)</a></li>
<li><a href="#knots_005fsort" accesskey="8">(knots sort)</a></li>
<li><a href="#knots_005fthread_002dpool" accesskey="9">(knots thread-pool)</a></li>
<li><a href="#knots_005ftimeout">(knots timeout)</a></li>
<li><a href="#knots_005fweb_002dserver">(knots web-server)</a></li>
<li><a href="#knots_005fweb">(knots web)</a></li>
</ul>
<hr>
<div class="section-level-extent" id="knots">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fbacktraces" accesskey="n" rel="next">(knots backtraces)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots_0029"><span>1.1 (knots)<a class="copiable-link" href="#g_t_0028knots_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Procedures" accesskey="1">Procedures</a></li>
<li><a href="#Record-Types" accesskey="2">Record Types</a></li>
</ul>
<div class="subsection-level-extent" id="Procedures">
<h4 class="subsection"><span>1.1.1 Procedures<a class="copiable-link" href="#Procedures"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002ddefault_002dio_002dwaiters"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-default-io-waiters</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-call_002dwith_002ddefault_002dio_002dwaiters"> &para;</a></span></dt>
<dd><p>Run THUNK with Guile&rsquo;s default blocking I/O waiters active.
</p>
<p>This is useful when restoring the default Guile I/O waiters from within
a context (like Fibers) where different I/O waiters are used, for
example when creating a new thread from a fiber.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002dsigint"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-sigint</strong> <var class="def-var-arguments">a b</var><a class="copiable-link" href="#index-call_002dwith_002dsigint"> &para;</a></span></dt>
<dd><p>Run THUNK with a SIGINT handler that signals the Fibers condition CVAR.
Restores the previous handler when THUNK returns.
</p>
<p>Typical usage is to pass a condition variable to this procedure and wait
on CVAR in a fiber to implement clean shutdown on Ctrl-C:
</p>
<div class="example">
<pre class="example-preformatted">(let ((quit-cvar (make-condition)))
(call-with-sigint
(lambda () (wait quit-cvar))
quit-cvar))
</pre></div>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002dtemporary_002dthread"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-temporary-thread</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-call_002dwith_002dtemporary_002dthread"> &para;</a></span></dt>
<dd><p>Run THUNK in a temporary thread and return its result to the calling
fiber.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-display_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">display/knots</strong> <var class="def-var-arguments">_ OPT: _</var><a class="copiable-link" href="#index-display_002fknots"> &para;</a></span></dt>
<dd><p>Write OBJ to PORT (default: current output port) as a UTF-8 byte
sequence via <code class="code">put-bytevector</code>.
</p>
<p>When used with ports without buffering, this should be safer than
display.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-format_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">format/knots</strong> <var class="def-var-arguments">a b . rest</var><a class="copiable-link" href="#index-format_002fknots"> &para;</a></span></dt>
<dd><p>Like <code class="code">format</code> but should be safer when used with a port without
buffering.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-knots_002dexception_002dstack"><span class="category-def">Procedure: </span><span><strong class="def-name">knots-exception-stack</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-knots_002dexception_002dstack"> &para;</a></span></dt>
<dd><p>Return the stack from a <code class="code">&amp;knots-exception</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-knots_002dexception_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">knots-exception?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-knots_002dexception_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;knots-exception</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dknots_002dexception"><span class="category-def">Procedure: </span><span><strong class="def-name">make-knots-exception</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-make_002dknots_002dexception"> &para;</a></span></dt>
<dd><p>Construct a <code class="code">&amp;knots-exception</code> with the given stack.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-print_002dbacktrace_002dand_002dexception_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">print-backtrace-and-exception/knots</strong> <var class="def-var-arguments">_ KEY: #:port</var><a class="copiable-link" href="#index-print_002dbacktrace_002dand_002dexception_002fknots"> &para;</a></span></dt>
<dd><p>Print the backtrace and exception information from EXN to PORT. This
procedure captures the stack, so should be run before the stack is
unwound, so using <code class="code">with-exception-handler</code> without <code class="code">#:unwind?
#t</code>, the exception may need to then be re-raised and handled in an outer
exception handler.
</p>
<div class="example">
<pre class="example-preformatted">(with-exception-handler
(lambda (exn)
;; Recover from the exception
#f)
(lambda ()
(with-exception-handler
(lambda (exn)
(print-backtrace-and-exception/knots exn)
(raise-exception exn))
(lambda ()
(do-things))))
#:unwind? #t)
</pre></div>
<p>It&rsquo;s important to use <code class="code">print-backtrace-and-exception/knots</code> for
displaying backtraces involving functionality from Guile Knots, since
the stack involved is potentially split across several fibers. The
stacks involved are attached to the exception, and this procedure
extracts this information out and assembles a backtrace including all
the code involved.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-simple_002dformat_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">simple-format/knots</strong> <var class="def-var-arguments">a b . rest</var><a class="copiable-link" href="#index-simple_002dformat_002fknots"> &para;</a></span></dt>
<dd><p>Like <code class="code">simple-format</code> but should be safer when used with a port
without buffering.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-spawn_002dfiber_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">spawn-fiber/knots</strong> <var class="def-var-arguments">_ OPT: _ KEY: #:parallel?</var><a class="copiable-link" href="#index-spawn_002dfiber_002fknots"> &para;</a></span></dt>
<dd><p>Spawn a fiber to run THUNK, with knots exception handling.
</p>
<p>Accepts the same optional SCHEDULER and <code class="code">#:parallel?</code> arguments as
<code class="code">spawn-fiber</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-wait_002dwhen_002dsystem_002dclock_002dbehind"><span class="category-def">Procedure: </span><span><strong class="def-name">wait-when-system-clock-behind</strong><a class="copiable-link" href="#index-wait_002dwhen_002dsystem_002dclock_002dbehind"> &para;</a></span></dt>
<dd><p>Block until the system clock reads at least 2001-01-02.
</p>
<p>Useful at startup in environments (virtual machines, embedded systems)
where the clock may start at or near the Unix epoch. Prints a warning
to the current error port every 20 seconds while waiting.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Record-Types">
<h4 class="subsection"><span>1.1.2 Record Types<a class="copiable-link" href="#Record-Types"> &para;</a></span></h4>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026knots_002dexception"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;knots-exception</strong><a class="copiable-link" href="#index-_0026knots_002dexception"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">stack</code></li></ul>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fbacktraces">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fnon_002dblocking" accesskey="n" rel="next">(knots non-blocking)</a>, Previous: <a href="#knots" accesskey="p" rel="prev">(knots)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-backtraces_0029"><span>1.2 (knots backtraces)<a class="copiable-link" href="#g_t_0028knots-backtraces_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Procedures-1" accesskey="1">Procedures</a></li>
<li><a href="#Record-Types-1" accesskey="2">Record Types</a></li>
</ul>
<div class="subsection-level-extent" id="Procedures-1">
<h4 class="subsection"><span>1.2.1 Procedures<a class="copiable-link" href="#Procedures-1"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-knots_002dexception_002dstack-1"><span class="category-def">Procedure: </span><span><strong class="def-name">knots-exception-stack</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-knots_002dexception_002dstack-1"> &para;</a></span></dt>
<dd><p>Return the stack from a <code class="code">&amp;knots-exception</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-knots_002dexception_003f-1"><span class="category-def">Procedure: </span><span><strong class="def-name">knots-exception?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-knots_002dexception_003f-1"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;knots-exception</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dknots_002dexception-1"><span class="category-def">Procedure: </span><span><strong class="def-name">make-knots-exception</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-make_002dknots_002dexception-1"> &para;</a></span></dt>
<dd><p>Construct a <code class="code">&amp;knots-exception</code> with the given stack.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-print_002dbacktrace_002dand_002dexception_002fknots-1"><span class="category-def">Procedure: </span><span><strong class="def-name">print-backtrace-and-exception/knots</strong> <var class="def-var-arguments">_ KEY: #:port</var><a class="copiable-link" href="#index-print_002dbacktrace_002dand_002dexception_002fknots-1"> &para;</a></span></dt>
<dd><p>Print the backtrace and exception information from EXN to PORT. This
procedure captures the stack, so should be run before the stack is
unwound, so using <code class="code">with-exception-handler</code> without <code class="code">#:unwind?
#t</code>, the exception may need to then be re-raised and handled in an outer
exception handler.
</p>
<div class="example">
<pre class="example-preformatted">(with-exception-handler
(lambda (exn)
;; Recover from the exception
#f)
(lambda ()
(with-exception-handler
(lambda (exn)
(print-backtrace-and-exception/knots exn)
(raise-exception exn))
(lambda ()
(do-things))))
#:unwind? #t)
</pre></div>
<p>It&rsquo;s important to use <code class="code">print-backtrace-and-exception/knots</code> for
displaying backtraces involving functionality from Guile Knots, since
the stack involved is potentially split across several fibers. The
stacks involved are attached to the exception, and this procedure
extracts this information out and assembles a backtrace including all
the code involved.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Record-Types-1">
<h4 class="subsection"><span>1.2.2 Record Types<a class="copiable-link" href="#Record-Types-1"> &para;</a></span></h4>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026knots_002dexception-1"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;knots-exception</strong><a class="copiable-link" href="#index-_0026knots_002dexception-1"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">stack</code></li></ul>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fnon_002dblocking">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fparallelism" accesskey="n" rel="next">(knots parallelism)</a>, Previous: <a href="#knots_005fbacktraces" accesskey="p" rel="prev">(knots backtraces)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-non_002dblocking_0029"><span>1.3 (knots non-blocking)<a class="copiable-link" href="#g_t_0028knots-non_002dblocking_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Procedures-2" accesskey="1">Procedures</a></li>
</ul>
<div class="subsection-level-extent" id="Procedures-2">
<h4 class="subsection"><span>1.3.1 Procedures<a class="copiable-link" href="#Procedures-2"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-non_002dblocking_002dopen_002dsocket_002dfor_002duri"><span class="category-def">Procedure: </span><span><strong class="def-name">non-blocking-open-socket-for-uri</strong> <var class="def-var-arguments">_ KEY: #:verify-certificate?</var><a class="copiable-link" href="#index-non_002dblocking_002dopen_002dsocket_002dfor_002duri"> &para;</a></span></dt>
<dd><p>Open a socket for URI and return it as a non-blocking port.
</p>
<p>For HTTPS URIs the TLS handshake is completed while the socket is still
blocking (required because Guile&rsquo;s TLS wrapper does not support
non-blocking handshakes), then the underlying socket is made
non-blocking. For plain HTTP the socket is made non-blocking
immediately.
</p>
<p><code class="code">#:verify-certificate?</code> controls TLS certificate verification and
defaults to <code class="code">#t</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-non_002dblocking_002dport"><span class="category-def">Procedure: </span><span><strong class="def-name">non-blocking-port</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-non_002dblocking_002dport"> &para;</a></span></dt>
<dd><p>Make PORT non-blocking and return it.
</p>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fparallelism">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fpromise" accesskey="n" rel="next">(knots promise)</a>, Previous: <a href="#knots_005fnon_002dblocking" accesskey="p" rel="prev">(knots non-blocking)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-parallelism_0029"><span>1.4 (knots parallelism)<a class="copiable-link" href="#g_t_0028knots-parallelism_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Macros" accesskey="1">Macros</a></li>
<li><a href="#Procedures-3" accesskey="2">Procedures</a></li>
</ul>
<div class="subsection-level-extent" id="Macros">
<h4 class="subsection"><span>1.4.1 Macros<a class="copiable-link" href="#Macros"> &para;</a></span></h4>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-fibers_002dlet"><span class="category-def">Macro: </span><span><strong class="def-name">fibers-let</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002dlet"> &para;</a></span></dt>
<dd><p>Let, but run each binding in a fiber in parallel.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-fibers_002dparallel"><span class="category-def">Macro: </span><span><strong class="def-name">fibers-parallel</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002dparallel"> &para;</a></span></dt>
<dd><p>Run each expression in parallel. If any expression raises an exception,
this will be raised after all exceptions have finished.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-parallelism_002dlimiter_003f"><span class="category-def">Macro: </span><span><strong class="def-name">parallelism-limiter?</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-parallelism_002dlimiter_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&lt;parallelism-limiter&gt;</code>.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-with_002dparallelism_002dlimiter"><span class="category-def">Macro: </span><span><strong class="def-name">with-parallelism-limiter</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-with_002dparallelism_002dlimiter"> &para;</a></span></dt>
<dd><p>Evaluate EXP ... while holding a slot from PARALLELISM-LIMITER.
Syntactic sugar around <code class="code">call-with-parallelism-limiter</code>.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Procedures-3">
<h4 class="subsection"><span>1.4.2 Procedures<a class="copiable-link" href="#Procedures-3"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002dparallelism_002dlimiter"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-parallelism-limiter</strong> <var class="def-var-arguments">a b</var><a class="copiable-link" href="#index-call_002dwith_002dparallelism_002dlimiter"> &para;</a></span></dt>
<dd><p>Acquire a slot from PARALLELISM-LIMITER, call THUNK, release the slot,
and return the values from THUNK. Blocks if no slot is currently
available.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-destroy_002dparallelism_002dlimiter"><span class="category-def">Procedure: </span><span><strong class="def-name">destroy-parallelism-limiter</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-destroy_002dparallelism_002dlimiter"> &para;</a></span></dt>
<dd><p>Destroy PARALLELISM-LIMITER, releasing its underlying resource pool.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fiberize"><span class="category-def">Procedure: </span><span><strong class="def-name">fiberize</strong> <var class="def-var-arguments">_ KEY: #:parallelism #:input-channel #:process-channel</var><a class="copiable-link" href="#index-fiberize"> &para;</a></span></dt>
<dd><p>Convert PROC into a procedure backed by <code class="code">#:parallelism</code> (default:
1) background fibers. Returns a wrapper that sends its arguments to one
of the fibers and blocks until the result is returned.
</p>
<p><code class="code">#:input-channel</code> is the channel that callers write requests to;
defaults to a fresh channel. <code class="code">#:process-channel</code> is the channel
the fibers read from; defaults to <code class="code">#:input-channel</code>. Setting them
differently allows external parties to bypass the wrapper and write
directly to <code class="code">process-channel</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dbatch_002dfor_002deach"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-batch-for-each</strong> <var class="def-var-arguments">a b . rest</var><a class="copiable-link" href="#index-fibers_002dbatch_002dfor_002deach"> &para;</a></span></dt>
<dd><p>Call PROC on LISTS, running up to PARALLELISM-LIMIT fibers in parallel.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dbatch_002dmap"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-batch-map</strong> <var class="def-var-arguments">a b . rest</var><a class="copiable-link" href="#index-fibers_002dbatch_002dmap"> &para;</a></span></dt>
<dd><p>Map PROC over LISTS in parallel, with a PARALLELISM-LIMIT. If any of
the invocations of PROC raise an exception, this will be raised once all
of the calls to PROC have finished.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dfor_002deach"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-for-each</strong> <var class="def-var-arguments">a . rest</var><a class="copiable-link" href="#index-fibers_002dfor_002deach"> &para;</a></span></dt>
<dd><p>Call PROC on LISTS, running up to 20 fibers in parallel.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dmap"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-map</strong> <var class="def-var-arguments">a . rest</var><a class="copiable-link" href="#index-fibers_002dmap"> &para;</a></span></dt>
<dd><p>Map PROC over LISTS in parallel, running up to 20 fibers in PARALLEL. If
any of the invocations of PROC raise an exception, this will be raised
once all of the calls to PROC have finished.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dmap_002dwith_002dprogress"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-map-with-progress</strong> <var class="def-var-arguments">_ _ KEY: #:report</var><a class="copiable-link" href="#index-fibers_002dmap_002dwith_002dprogress"> &para;</a></span></dt>
<dd><p>Map PROC over LISTS, calling #:REPORT if specified after each invocation
of PROC finishes. REPORT is passed the results for each element of
LISTS, or #f if no result has been received yet.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dparallelism_002dlimiter"><span class="category-def">Procedure: </span><span><strong class="def-name">make-parallelism-limiter</strong> <var class="def-var-arguments">_ KEY: #:name</var><a class="copiable-link" href="#index-make_002dparallelism_002dlimiter"> &para;</a></span></dt>
<dd><p>Return a parallelism limiter that allows at most LIMIT concurrent fibers
to execute within <code class="code">with-parallelism-limiter</code> at the same time.
Further fibers block until a slot becomes free.
</p>
<p><code class="code">#:name</code> is a string used in log messages. Defaults to
<code class="code">&quot;unnamed&quot;</code>.
</p>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fpromise">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fqueue" accesskey="n" rel="next">(knots queue)</a>, Previous: <a href="#knots_005fparallelism" accesskey="p" rel="prev">(knots parallelism)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-promise_0029"><span>1.5 (knots promise)<a class="copiable-link" href="#g_t_0028knots-promise_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Macros-1" accesskey="1">Macros</a></li>
<li><a href="#Procedures-4" accesskey="2">Procedures</a></li>
</ul>
<div class="subsection-level-extent" id="Macros-1">
<h4 class="subsection"><span>1.5.1 Macros<a class="copiable-link" href="#Macros-1"> &para;</a></span></h4>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-fibers_002dpromise_003f"><span class="category-def">Macro: </span><span><strong class="def-name">fibers-promise?</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002dpromise_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&lt;fibers-promise&gt;</code>.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Procedures-4">
<h4 class="subsection"><span>1.5.2 Procedures<a class="copiable-link" href="#Procedures-4"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002ddelay"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-delay</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002ddelay"> &para;</a></span></dt>
<dd><p>Return a new fiber-aware promise that will evaluate THUNK when first
forced. THUNK is not called until <code class="code">fibers-force</code> is called on the
promise.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002ddelay_002feager"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-delay/eager</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002ddelay_002feager"> &para;</a></span></dt>
<dd><p>Return a new fiber-aware promise and immediately begin evaluating THUNK
in a new fiber. Exceptions during eager evaluation are silently
discarded; they will be re-raised when <code class="code">fibers-force</code> is called.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dforce"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-force</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002dforce"> &para;</a></span></dt>
<dd><p>Force the fiber-aware promise FP, returning its values.
</p>
<p>The first call evaluates the promise&rsquo;s thunk. Concurrent callers block
on a condition variable until evaluation finishes, then receive the same
result. If the thunk raises an exception, the exception is stored and
re-raised for all callers.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dpromise_002dreset"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-promise-reset</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002dpromise_002dreset"> &para;</a></span></dt>
<dd><p>Reset the fiber-aware promise FP so that the next call to
<code class="code">fibers-force</code> re-evaluates its thunk.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dpromise_002dresult_002davailable_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-promise-result-available?</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fibers_002dpromise_002dresult_002davailable_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if the fiber-aware promise FP has been evaluated
(successfully or with an exception) and <code class="code">#f</code> if evaluation has not
yet started or is still in progress.
</p>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fqueue">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fresource_002dpool" accesskey="n" rel="next">(knots resource-pool)</a>, Previous: <a href="#knots_005fpromise" accesskey="p" rel="prev">(knots promise)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-queue_0029"><span>1.6 (knots queue)<a class="copiable-link" href="#g_t_0028knots-queue_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Procedures-5" accesskey="1">Procedures</a></li>
</ul>
<div class="subsection-level-extent" id="Procedures-5">
<h4 class="subsection"><span>1.6.1 Procedures<a class="copiable-link" href="#Procedures-5"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-spawn_002dqueueing_002dfiber"><span class="category-def">Procedure: </span><span><strong class="def-name">spawn-queueing-fiber</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-spawn_002dqueueing_002dfiber"> &para;</a></span></dt>
<dd><p>Spawn a fiber that serialises items onto DEST-CHANNEL in FIFO order.
Returns a new input channel.
</p>
<p>Multiple producers can put items on the returned channel concurrently.
The fiber buffers them locally and forwards them to DEST-CHANNEL one at
a time, preserving arrival order.
</p>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fresource_002dpool">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fsort" accesskey="n" rel="next">(knots sort)</a>, Previous: <a href="#knots_005fqueue" accesskey="p" rel="prev">(knots queue)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-resource_002dpool_0029"><span>1.7 (knots resource-pool)<a class="copiable-link" href="#g_t_0028knots-resource_002dpool_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Macros-2" accesskey="1">Macros</a></li>
<li><a href="#Parameters" accesskey="2">Parameters</a></li>
<li><a href="#Procedures-6" accesskey="3">Procedures</a></li>
<li><a href="#Record-Types-2" accesskey="4">Record Types</a></li>
</ul>
<div class="subsection-level-extent" id="Macros-2">
<h4 class="subsection"><span>1.7.1 Macros<a class="copiable-link" href="#Macros-2"> &para;</a></span></h4>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-resource_002dpool_002dchannel"><span class="category-def">Macro: </span><span><strong class="def-name">resource-pool-channel</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-resource_002dpool_002dchannel"> &para;</a></span></dt>
<dd><p>Return the channel used by the resource pool.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-resource_002dpool_002dconfiguration"><span class="category-def">Macro: </span><span><strong class="def-name">resource-pool-configuration</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-resource_002dpool_002dconfiguration"> &para;</a></span></dt>
<dd><p>Return the configuration alist of the resource pool.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-resource_002dpool_002dname"><span class="category-def">Macro: </span><span><strong class="def-name">resource-pool-name</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-resource_002dpool_002dname"> &para;</a></span></dt>
<dd><p>Return the name of the resource pool.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-resource_002dpool_003f"><span class="category-def">Macro: </span><span><strong class="def-name">resource-pool?</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-resource_002dpool_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&lt;resource-pool&gt;</code>.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-with_002dresource_002dfrom_002dpool"><span class="category-def">Macro: </span><span><strong class="def-name">with-resource-from-pool</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-with_002dresource_002dfrom_002dpool"> &para;</a></span></dt>
<dd><p>Evaluate EXP ... with RESOURCE bound to a resource checked out from
POOL. Syntactic sugar around <code class="code">call-with-resource-from-pool</code>.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Parameters">
<h4 class="subsection"><span>1.7.2 Parameters<a class="copiable-link" href="#Parameters"> &para;</a></span></h4>
<dl class="first-defvr">
<dt class="defvr" id="index-resource_002dpool_002ddefault_002dtimeout_002dhandler"><span class="category-def">Parameter: </span><span><strong class="def-name">resource-pool-default-timeout-handler</strong><a class="copiable-link" href="#index-resource_002dpool_002ddefault_002dtimeout_002dhandler"> &para;</a></span></dt>
<dd><p>Default value:
</p>
<pre class="verbatim">#f
</pre>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Procedures-6">
<h4 class="subsection"><span>1.7.3 Procedures<a class="copiable-link" href="#Procedures-6"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002dresource_002dfrom_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-resource-from-pool</strong> <var class="def-var-arguments">_ _ KEY: #:timeout #:timeout-handler #:max-waiters #:channel #:destroy-resource-on-exception?</var><a class="copiable-link" href="#index-call_002dwith_002dresource_002dfrom_002dpool"> &para;</a></span></dt>
<dd><p>Call PROC with a resource from POOL, blocking until a resource becomes
available. Return the resource once PROC has returned.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-destroy_002dresource_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">destroy-resource-pool</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-destroy_002dresource_002dpool"> &para;</a></span></dt>
<dd><p>Destroy POOL, preventing any new checkouts. Blocks until all
checked-out resources have been returned, running the pool&rsquo;s
<code class="code">#:destructor</code> on each. Any fibers waiting for a resource receive
<code class="code">&amp;resource-pool-destroyed</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dfixed_002dsize_002dresource_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">make-fixed-size-resource-pool</strong> <var class="def-var-arguments">_ KEY: #:delay-logger #:duration-logger #:scheduler #:name #:default-checkout-timeout #:default-max-waiters</var><a class="copiable-link" href="#index-make_002dfixed_002dsize_002dresource_002dpool"> &para;</a></span></dt>
<dd><p>Create a resource pool from RESOURCES-LIST-OR-VECTOR, a list or vector
of pre-existing resource values.
</p>
<p>Use <code class="code">with-resource-from-pool</code> or
<code class="code">call-with-resource-from-pool</code> to borrow a resource and return it
automatically when done.
</p>
<p>Optional keyword arguments:
</p>
<dl class="table">
<dt><code class="code">#:name</code></dt>
<dd><p>A optional string used in log messages. Defaults to <code class="code">&quot;unnamed&quot;</code>.
</p>
</dd>
<dt><code class="code">#:default-checkout-timeout</code></dt>
<dd><p>Default checkout timeout when requesting a resource from the pool, unset
by default.
</p>
</dd>
<dt><code class="code">#:default-max-waiters</code></dt>
<dd><p>Maximum number of fibers that may queue waiting for a resource. When
this limit is exceeded, <code class="code">&amp;resource-pool-too-many-waiters</code> is raised
when a resource is requested. Defaults to <code class="code">#f</code> (no limit).
</p>
</dd>
<dt><code class="code">#:scheduler</code></dt>
<dd><p>The Fibers scheduler to use for the pool&rsquo;s internal fiber. Defaults to
the current scheduler.
</p>
</dd>
</dl>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dresource_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">make-resource-pool</strong> <var class="def-var-arguments">_ _ KEY: #:min-size #:idle-seconds #:delay-logger #:duration-logger #:destructor #:lifetime #:scheduler #:name #:add-resources-parallelism #:default-checkout-timeout #:default-max-waiters</var><a class="copiable-link" href="#index-make_002dresource_002dpool"> &para;</a></span></dt>
<dd><p>Create a dynamic resource pool. RETURN-NEW-RESOURCE is a thunk called
to create each new resource value. MAX-SIZE is the maximum number of
resources the pool will hold simultaneously.
</p>
<p>Resources are created on demand when a checkout is requested and the
pool is not yet at MAX-SIZE. Use <code class="code">with-resource-from-pool</code> or
<code class="code">call-with-resource-from-pool</code> to request a resource and return it
automatically when done.
</p>
<p>Optional keyword arguments:
</p>
<dl class="table">
<dt><code class="code">#:min-size</code></dt>
<dd><p>Minimum number of resources to keep alive even when idle. Defaults to
<code class="code">0</code>.
</p>
</dd>
<dt><code class="code">#:idle-seconds</code></dt>
<dd><p>Seconds a resource may remain unused before being destroyed, provided
the pool is above <code class="code">#:min-size</code>. Defaults to <code class="code">#f</code> (never
expire idle resources).
</p>
</dd>
<dt><code class="code">#:lifetime</code></dt>
<dd><p>Maximum number of checkouts a single resource will serve before being
destroyed and replaced by a fresh one. Defaults to <code class="code">#f</code> (no
limit).
</p>
</dd>
<dt><code class="code">#:destructor</code></dt>
<dd><p>A procedure called as <code class="code">(destructor resource)</code> when a resource is
removed from the pool. Defaults to <code class="code">#f</code>.
</p>
</dd>
<dt><code class="code">#:add-resources-parallelism</code></dt>
<dd><p>Maximum number of concurrent calls to RETURN-NEW-RESOURCE when the pool
needs to grow. Allowing resources to be created in parallel can result
in more resources being created than can fit inside the pool, if this
happens, the surplus resources are destroyed. Defaults to <code class="code">1</code>.
</p>
</dd>
<dt><code class="code">#:name</code></dt>
<dd><p>A string used in log messages. Defaults to <code class="code">&quot;unnamed&quot;</code>.
</p>
</dd>
<dt><code class="code">#:default-checkout-timeout</code></dt>
<dd><p>Default checkout timeout when requesting a resource from the pool, unset
by default.
</p>
</dd>
<dt><code class="code">#:default-max-waiters</code></dt>
<dd><p>Maximum number of fibers that may queue waiting for a resource. When
this limit is exceeded, <code class="code">&amp;resource-pool-too-many-waiters</code> is raised
when a resource is requested. Defaults to <code class="code">#f</code> (no limit).
</p>
</dd>
<dt><code class="code">#:scheduler</code></dt>
<dd><p>The Fibers scheduler to use for the pool&rsquo;s internal fiber. Defaults to
the current scheduler.
</p>
</dd>
</dl>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dresource_002dpool_002ddestroy_002dresource_002dexception"><span class="category-def">Procedure: </span><span><strong class="def-name">make-resource-pool-destroy-resource-exception</strong><a class="copiable-link" href="#index-make_002dresource_002dpool_002ddestroy_002dresource_002dexception"> &para;</a></span></dt>
<dd><p>Construct a <code class="code">&amp;resource-pool-destroy-resource</code> exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002ddestroy_002dresource_002dexception_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-destroy-resource-exception?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002ddestroy_002dresource_002dexception_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;resource-pool-destroy-resource</code>
exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002ddestroyed_002derror_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-destroyed-error-pool</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002ddestroyed_002derror_002dpool"> &para;</a></span></dt>
<dd><p>Return the pool from a <code class="code">&amp;resource-pool-destroyed</code> exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002ddestroyed_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-destroyed-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002ddestroyed_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;resource-pool-destroyed</code> exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002dstats"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-stats</strong> <var class="def-var-arguments">_ KEY: #:timeout</var><a class="copiable-link" href="#index-resource_002dpool_002dstats"> &para;</a></span></dt>
<dd><p>Return an alist of statistics for POOL with the following keys:
</p>
<dl class="table">
<dt><code class="code">resources</code></dt>
<dd><p>Total number of resources currently held by the pool.
</p>
</dd>
<dt><code class="code">available</code></dt>
<dd><p>Number of resources not currently checked out.
</p>
</dd>
<dt><code class="code">waiters</code></dt>
<dd><p>Number of fibers currently queued waiting for a resource.
</p>
</dd>
<dt><code class="code">checkout-failure-count</code></dt>
<dd><p>Cumulative number of checkouts where an exception was raised inside the
proc.
</p>
</dd>
</dl>
<p>Blocks waiting for the pool fiber to respond. <code class="code">#:timeout</code> is the
number of seconds to wait; defaults to <code class="code">5</code>. Raises
<code class="code">&amp;resource-pool-timeout</code> if the pool does not respond in time.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002dtimeout_002derror_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-timeout-error-pool</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002dtimeout_002derror_002dpool"> &para;</a></span></dt>
<dd><p>Return the pool from a <code class="code">&amp;resource-pool-timeout</code> exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002dtimeout_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-timeout-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002dtimeout_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;resource-pool-timeout</code> exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-too-many-waiters-error-pool</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_002dpool"> &para;</a></span></dt>
<dd><p>Return the pool from a <code class="code">&amp;resource-pool-too-many-waiters</code> exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_002dwaiters_002dcount"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-too-many-waiters-error-waiters-count</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_002dwaiters_002dcount"> &para;</a></span></dt>
<dd><p>Return the waiters count from a <code class="code">&amp;resource-pool-too-many-waiters</code>
exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">resource-pool-too-many-waiters-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;resource-pool-too-many-waiters</code>
exception.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Record-Types-2">
<h4 class="subsection"><span>1.7.4 Record Types<a class="copiable-link" href="#Record-Types-2"> &para;</a></span></h4>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026resource_002dpool_002ddestroy_002dresource"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;resource-pool-destroy-resource</strong><a class="copiable-link" href="#index-_0026resource_002dpool_002ddestroy_002dresource"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
</ul>
</dd></dl>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026resource_002dpool_002ddestroyed"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;resource-pool-destroyed</strong><a class="copiable-link" href="#index-_0026resource_002dpool_002ddestroyed"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">pool</code></li></ul>
</dd></dl>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026resource_002dpool_002dtimeout"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;resource-pool-timeout</strong><a class="copiable-link" href="#index-_0026resource_002dpool_002dtimeout"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">pool</code></li></ul>
</dd></dl>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026resource_002dpool_002dtoo_002dmany_002dwaiters"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;resource-pool-too-many-waiters</strong><a class="copiable-link" href="#index-_0026resource_002dpool_002dtoo_002dmany_002dwaiters"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">pool</code></li><li><code class="code">waiters-count</code></li></ul>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fsort">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fthread_002dpool" accesskey="n" rel="next">(knots thread-pool)</a>, Previous: <a href="#knots_005fresource_002dpool" accesskey="p" rel="prev">(knots resource-pool)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-sort_0029"><span>1.8 (knots sort)<a class="copiable-link" href="#g_t_0028knots-sort_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Procedures-7" accesskey="1">Procedures</a></li>
</ul>
<div class="subsection-level-extent" id="Procedures-7">
<h4 class="subsection"><span>1.8.1 Procedures<a class="copiable-link" href="#Procedures-7"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-fibers_002dsort_0021"><span class="category-def">Procedure: </span><span><strong class="def-name">fibers-sort!</strong> <var class="def-var-arguments">_ _ KEY: #:parallelism</var><a class="copiable-link" href="#index-fibers_002dsort_0021"> &para;</a></span></dt>
<dd><p>Sort ITEMS destructively using LESS as the comparison procedure, using a
parallel merge sort. Returns the sorted list.
</p>
<p>Splits ITEMS into chunks, sorts each in an eager fiber-promise in
parallel, then merges pairs of sorted chunks in parallel until one
sorted list remains.
</p>
<p><code class="code">#:parallelism</code> sets the number of initial chunks. Defaults to the
current fibers parallelism.
</p>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fthread_002dpool">
<div class="nav-panel">
<p>
Next: <a href="#knots_005ftimeout" accesskey="n" rel="next">(knots timeout)</a>, Previous: <a href="#knots_005fsort" accesskey="p" rel="prev">(knots sort)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-thread_002dpool_0029"><span>1.9 (knots thread-pool)<a class="copiable-link" href="#g_t_0028knots-thread_002dpool_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Macros-3" accesskey="1">Macros</a></li>
<li><a href="#Procedures-8" accesskey="2">Procedures</a></li>
<li><a href="#Record-Types-3" accesskey="3">Record Types</a></li>
</ul>
<div class="subsection-level-extent" id="Macros-3">
<h4 class="subsection"><span>1.9.1 Macros<a class="copiable-link" href="#Macros-3"> &para;</a></span></h4>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-fixed_002dsize_002dthread_002dpool_002dchannel"><span class="category-def">Macro: </span><span><strong class="def-name">fixed-size-thread-pool-channel</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fixed_002dsize_002dthread_002dpool_002dchannel"> &para;</a></span></dt>
<dd><p>Return the channel of the fixed-size thread pool.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-fixed_002dsize_002dthread_002dpool_002dcurrent_002dprocedures"><span class="category-def">Macro: </span><span><strong class="def-name">fixed-size-thread-pool-current-procedures</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fixed_002dsize_002dthread_002dpool_002dcurrent_002dprocedures"> &para;</a></span></dt>
<dd><p>Return the current procedures vector of the fixed-size thread pool.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-fixed_002dsize_002dthread_002dpool_003f"><span class="category-def">Macro: </span><span><strong class="def-name">fixed-size-thread-pool?</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-fixed_002dsize_002dthread_002dpool_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&lt;fixed-size-thread-pool&gt;</code>.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-thread_002dpool_002dresource_002dpool"><span class="category-def">Macro: </span><span><strong class="def-name">thread-pool-resource-pool</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-thread_002dpool_002dresource_002dpool"> &para;</a></span></dt>
<dd><p>Return the underlying resource pool of the thread pool.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-thread_002dpool_003f"><span class="category-def">Macro: </span><span><strong class="def-name">thread-pool?</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-thread_002dpool_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&lt;thread-pool&gt;</code>.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Procedures-8">
<h4 class="subsection"><span>1.9.2 Procedures<a class="copiable-link" href="#Procedures-8"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002dthread"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-thread</strong> <var class="def-var-arguments">_ _ KEY: #:duration-logger #:checkout-timeout #:channel #:destroy-thread-on-exception? #:max-waiters</var><a class="copiable-link" href="#index-call_002dwith_002dthread"> &para;</a></span></dt>
<dd><p>Run PROC in THREAD-POOL and return its values, blocking until complete.
If called from within a thread that already belongs to THREAD-POOL, PROC
is called directly in that thread.
</p>
<p>Optional keyword arguments:
</p>
<dl class="table">
<dt><code class="code">#:checkout-timeout</code></dt>
<dd><p>Seconds to wait for a free thread before raising
<code class="code">&amp;thread-pool-timeout-error</code>. Defaults to the pool&rsquo;s
<code class="code">#:default-checkout-timeout</code>.
</p>
</dd>
<dt><code class="code">#:max-waiters</code></dt>
<dd><p>Maximum number of fibers that may queue waiting for a thread (for
dynamic pools). Defaults to the pool&rsquo;s <code class="code">#:default-max-waiters</code>.
</p>
</dd>
<dt><code class="code">#:destroy-thread-on-exception?</code></dt>
<dd><p>When <code class="code">#t</code>, destroy the thread after PROC raises an exception.
Equivalent to per-call <code class="code">#:expire-on-exception?</code>. Defaults to
<code class="code">#f</code>.
</p>
</dd>
<dt><code class="code">#:duration-logger</code></dt>
<dd><p>Called as <code class="code">(duration-logger seconds)</code> after PROC completes (whether
or not it raised an exception).
</p>
</dd>
<dt><code class="code">#:channel</code></dt>
<dd><p>Override the channel used to communicate with the thread.
</p>
</dd>
</dl>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-destroy_002dthread_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">destroy-thread-pool</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-destroy_002dthread_002dpool"> &para;</a></span></dt>
<dd><p>Destroy POOL, stopping all of its threads and calling the destructor if
specified. This procedure will block until the destruction is complete.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dfixed_002dsize_002dthread_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">make-fixed-size-thread-pool</strong> <var class="def-var-arguments">_ KEY: #:thread-initializer #:thread-destructor #:delay-logger #:duration-logger #:thread-lifetime #:expire-on-exception? #:name #:use-default-io-waiters? #:default-checkout-timeout</var><a class="copiable-link" href="#index-make_002dfixed_002dsize_002dthread_002dpool"> &para;</a></span></dt>
<dd><p>Create a pool of SIZE threads started immediately. Use
<code class="code">call-with-thread</code> to run a procedure in one of the threads.
</p>
<p>Optional keyword arguments:
</p>
<dl class="table">
<dt><code class="code">#:thread-initializer</code></dt>
<dd><p>A thunk called once when each thread starts. Its return value is passed
as extra arguments to every procedure run in that thread. Defaults to
<code class="code">#f</code> (no extra arguments).
</p>
</dd>
<dt><code class="code">#:thread-destructor</code></dt>
<dd><p>A procedure called with the value returned by
<code class="code">#:thread-initializer</code> when a thread exits. Defaults to <code class="code">#f</code>.
</p>
</dd>
<dt><code class="code">#:thread-lifetime</code></dt>
<dd><p>Maximum number of procedures a thread will run before restarting (and
re-running <code class="code">#:thread-initializer</code>). Defaults to <code class="code">#f</code> (no
limit).
</p>
</dd>
<dt><code class="code">#:expire-on-exception?</code></dt>
<dd><p>When <code class="code">#t</code>, replace a thread after any unhandled exception. Defaults
to <code class="code">#f</code>.
</p>
</dd>
<dt><code class="code">#:use-default-io-waiters?</code></dt>
<dd><p>When <code class="code">#t</code> (the default), each thread uses blocking I/O waiters so
that port reads and writes block the thread rather than trying to
suspend a fiber.
</p>
</dd>
<dt><code class="code">#:name</code></dt>
<dd><p>String used in thread names and log messages. Defaults to
<code class="code">&quot;unnamed&quot;</code>.
</p>
</dd>
<dt><code class="code">#:default-checkout-timeout</code></dt>
<dd><p>Seconds to wait for a free thread slot before raising
<code class="code">&amp;thread-pool-timeout-error</code>. Defaults to <code class="code">#f</code> (wait
forever).
</p>
</dd>
<dt><code class="code">#:delay-logger</code></dt>
<dd><p>Called as <code class="code">(delay-logger seconds proc)</code> with the time spent waiting
for a thread to become available.
</p>
</dd>
<dt><code class="code">#:duration-logger</code></dt>
<dd><p>Called as <code class="code">(duration-logger seconds proc)</code> after each procedure
completes.
</p>
</dd>
</dl>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dthread_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">make-thread-pool</strong> <var class="def-var-arguments">_ KEY: #:min-size #:scheduler #:thread-initializer #:thread-destructor #:delay-logger #:duration-logger #:thread-lifetime #:expire-on-exception? #:name #:use-default-io-waiters? #:default-checkout-timeout #:default-max-waiters</var><a class="copiable-link" href="#index-make_002dthread_002dpool"> &para;</a></span></dt>
<dd><p>Create a dynamic thread pool with up to MAX-SIZE threads. Use
<code class="code">call-with-thread</code> to run a procedure in one of the threads.
</p>
<p>Unlike <code class="code">make-fixed-size-thread-pool</code>, threads are created on demand
and may be reclaimed when idle (controlled by <code class="code">#:min-size</code> and the
resource pool&rsquo;s idle management).
</p>
<p>Accepts the same <code class="code">#:thread-initializer</code>,
<code class="code">#:thread-destructor</code>, <code class="code">#:thread-lifetime</code>,
<code class="code">#:expire-on-exception?</code>, <code class="code">#:use-default-io-waiters?</code>,
<code class="code">#:name</code>, <code class="code">#:default-checkout-timeout</code>, <code class="code">#:delay-logger</code>,
and <code class="code">#:duration-logger</code> arguments as
<code class="code">make-fixed-size-thread-pool</code>, plus:
</p>
<dl class="table">
<dt><code class="code">#:min-size</code></dt>
<dd><p>Minimum number of threads to keep alive. Defaults to MAX-SIZE (i.e.:
the pool is pre-filled and never shrinks).
</p>
</dd>
<dt><code class="code">#:scheduler</code></dt>
<dd><p>Fibers scheduler for the pool&rsquo;s internal resource pool fiber. Defaults
to the current scheduler.
</p>
</dd>
<dt><code class="code">#:default-max-waiters</code></dt>
<dd><p>Maximum number of fibers that may queue waiting for a thread. Raises
<code class="code">&amp;thread-pool-timeout-error</code> when exceeded. Defaults to <code class="code">#f</code>
(no limit).
</p>
</dd>
</dl>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-set_002dthread_002dname"><span class="category-def">Procedure: </span><span><strong class="def-name">set-thread-name</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-set_002dthread_002dname"> &para;</a></span></dt>
<dd><p>Set the name of the calling thread to NAME. NAME is truncated to 15
bytes.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-thread_002dname"><span class="category-def">Procedure: </span><span><strong class="def-name">thread-name</strong><a class="copiable-link" href="#index-thread_002dname"> &para;</a></span></dt>
<dd><p>Return the name of the calling thread as a string.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-thread_002dpool_002darguments_002dparameter"><span class="category-def">Procedure: </span><span><strong class="def-name">thread-pool-arguments-parameter</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-thread_002dpool_002darguments_002dparameter"> &para;</a></span></dt>
<dd><p>Return the arguments parameter for POOL, dispatching on pool type.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-thread_002dpool_002ddefault_002dcheckout_002dtimeout"><span class="category-def">Procedure: </span><span><strong class="def-name">thread-pool-default-checkout-timeout</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-thread_002dpool_002ddefault_002dcheckout_002dtimeout"> &para;</a></span></dt>
<dd><p>Return the default checkout timeout for POOL.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-thread_002dpool_002dtimeout_002derror_002dpool"><span class="category-def">Procedure: </span><span><strong class="def-name">thread-pool-timeout-error-pool</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-thread_002dpool_002dtimeout_002derror_002dpool"> &para;</a></span></dt>
<dd><p>Return the pool from a <code class="code">&amp;thread-pool-timeout-error</code> exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-thread_002dpool_002dtimeout_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">thread-pool-timeout-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-thread_002dpool_002dtimeout_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;thread-pool-timeout-error</code>
exception.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Record-Types-3">
<h4 class="subsection"><span>1.9.3 Record Types<a class="copiable-link" href="#Record-Types-3"> &para;</a></span></h4>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026thread_002dpool_002dtimeout_002derror"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;thread-pool-timeout-error</strong><a class="copiable-link" href="#index-_0026thread_002dpool_002dtimeout_002derror"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">pool</code></li></ul>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005ftimeout">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fweb_002dserver" accesskey="n" rel="next">(knots web-server)</a>, Previous: <a href="#knots_005fthread_002dpool" accesskey="p" rel="prev">(knots thread-pool)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-timeout_0029"><span>1.10 (knots timeout)<a class="copiable-link" href="#g_t_0028knots-timeout_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Procedures-9" accesskey="1">Procedures</a></li>
<li><a href="#Record-Types-4" accesskey="2">Record Types</a></li>
</ul>
<div class="subsection-level-extent" id="Procedures-9">
<h4 class="subsection"><span>1.10.1 Procedures<a class="copiable-link" href="#Procedures-9"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-port_002dread_002dtimeout_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">port-read-timeout-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-port_002dread_002dtimeout_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;port-read-timeout-error</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-port_002dtimeout_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">port-timeout-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-port_002dtimeout_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;port-timeout-error</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-port_002dwrite_002dtimeout_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">port-write-timeout-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-port_002dwrite_002dtimeout_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;port-write-timeout-error</code>.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-wait_002duntil_002dport_002dreadable_002doperation"><span class="category-def">Procedure: </span><span><strong class="def-name">wait-until-port-readable-operation</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-wait_002duntil_002dport_002dreadable_002doperation"> &para;</a></span></dt>
<dd><p>Make an operation that will succeed when PORT is readable.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-wait_002duntil_002dport_002dwritable_002doperation"><span class="category-def">Procedure: </span><span><strong class="def-name">wait-until-port-writable-operation</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-wait_002duntil_002dport_002dwritable_002doperation"> &para;</a></span></dt>
<dd><p>Make an operation that will succeed when PORT is writable.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-with_002dfibers_002dtimeout"><span class="category-def">Procedure: </span><span><strong class="def-name">with-fibers-timeout</strong> <var class="def-var-arguments">_ KEY: #:timeout #:on-timeout</var><a class="copiable-link" href="#index-with_002dfibers_002dtimeout"> &para;</a></span></dt>
<dd><p>Run THUNK in a new fiber and return its values, waiting TIMEOUT seconds
for it to finish. If THUNK does not complete within TIMEOUT seconds,
the ON-TIMEOUT procedure is called and with-fibers-timeout returns the
result of ON-TIMEOUT instead.
</p>
<p>If THUNK raises an exception it is re-raised in the calling fiber.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-with_002dport_002dtimeouts"><span class="category-def">Procedure: </span><span><strong class="def-name">with-port-timeouts</strong> <var class="def-var-arguments">_ KEY: #:timeout #:read-timeout #:write-timeout</var><a class="copiable-link" href="#index-with_002dport_002dtimeouts"> &para;</a></span></dt>
<dd><p>Run THUNK with per-operation I/O timeouts on all ports. If any read or
write blocks for longer than the given number of seconds, an exception
is raised.
</p>
<p><code class="code">#:timeout</code> sets both read and write timeouts.
<code class="code">#:read-timeout</code> and <code class="code">#:write-timeout</code> specify the timeout for
reads and writes respectively. All three default to <code class="code">#f</code> (no
timeout).
</p>
<p>This procedure works both with fibers, and without fibers by using the
poll system call with a timeout.
</p>
<p>On read timeout, raises <code class="code">&amp;port-read-timeout-error</code>. On write
timeout, raises <code class="code">&amp;port-write-timeout-error</code>. Both carry the
<code class="code">thunk</code> and <code class="code">port</code> fields from <code class="code">&amp;port-timeout-error</code>.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Record-Types-4">
<h4 class="subsection"><span>1.10.2 Record Types<a class="copiable-link" href="#Record-Types-4"> &para;</a></span></h4>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026port_002dread_002dtimeout_002derror"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;port-read-timeout-error</strong><a class="copiable-link" href="#index-_0026port_002dread_002dtimeout_002derror"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">thunk</code></li><li><code class="code">port</code></li></ul>
</dd></dl>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026port_002dtimeout_002derror"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;port-timeout-error</strong><a class="copiable-link" href="#index-_0026port_002dtimeout_002derror"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">thunk</code></li><li><code class="code">port</code></li></ul>
</dd></dl>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026port_002dwrite_002dtimeout_002derror"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;port-write-timeout-error</strong><a class="copiable-link" href="#index-_0026port_002dwrite_002dtimeout_002derror"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">thunk</code></li><li><code class="code">port</code></li></ul>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fweb_002dserver">
<div class="nav-panel">
<p>
Next: <a href="#knots_005fweb" accesskey="n" rel="next">(knots web)</a>, Previous: <a href="#knots_005ftimeout" accesskey="p" rel="prev">(knots timeout)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-web_002dserver_0029"><span>1.11 (knots web-server)<a class="copiable-link" href="#g_t_0028knots-web_002dserver_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Macros-4" accesskey="1">Macros</a></li>
<li><a href="#Procedures-10" accesskey="2">Procedures</a></li>
<li><a href="#Record-Types-5" accesskey="3">Record Types</a></li>
</ul>
<div class="subsection-level-extent" id="Macros-4">
<h4 class="subsection"><span>1.11.1 Macros<a class="copiable-link" href="#Macros-4"> &para;</a></span></h4>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-web_002dserver_002dport"><span class="category-def">Macro: </span><span><strong class="def-name">web-server-port</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-web_002dserver_002dport"> &para;</a></span></dt>
<dd><p>Return the port number of the web server.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-web_002dserver_002dsocket"><span class="category-def">Macro: </span><span><strong class="def-name">web-server-socket</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-web_002dserver_002dsocket"> &para;</a></span></dt>
<dd><p>Return the socket of the web server.
</p>
</dd></dl>
<dl class="first-deffn first-defmac-alias-first-deffn">
<dt class="deffn defmac-alias-deffn" id="index-web_002dserver_003f"><span class="category-def">Macro: </span><span><strong class="def-name">web-server?</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-web_002dserver_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&lt;web-server&gt;</code>.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Procedures-10">
<h4 class="subsection"><span>1.11.2 Procedures<a class="copiable-link" href="#Procedures-10"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-default_002dwrite_002dresponse_002dexception_002dhandler"><span class="category-def">Procedure: </span><span><strong class="def-name">default-write-response-exception-handler</strong> <var class="def-var-arguments">a b</var><a class="copiable-link" href="#index-default_002dwrite_002dresponse_002dexception_002dhandler"> &para;</a></span></dt>
<dd><p>Default handler for exceptions raised while writing an HTTP response.
Logs the error for REQUEST to the current error port.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dchunked_002doutput_002dport_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">make-chunked-output-port/knots</strong> <var class="def-var-arguments">_ KEY: #:keep-alive? #:buffering</var><a class="copiable-link" href="#index-make_002dchunked_002doutput_002dport_002fknots"> &para;</a></span></dt>
<dd><p>Returns a new port which translates non-encoded data into a HTTP chunked
transfer encoded data and writes this to PORT. Data written to this
port is buffered until the port is flushed, at which point it is all
sent as one chunk. The port will otherwise be flushed every BUFFERING
bytes, which defaults to 1200. Take care to close the port when done,
as it will output the remaining data, and encode the final zero chunk.
When the port is closed it will also close PORT, unless KEEP-ALIVE? is
true.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-read_002drequest_002dbody_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">read-request-body/knots</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-read_002drequest_002dbody_002fknots"> &para;</a></span></dt>
<dd><p>Read and return the full body of request R as a bytevector. Handles
chunked transfer encoding.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-request_002dbody_002dended_002dprematurely_002derror_003f"><span class="category-def">Procedure: </span><span><strong class="def-name">request-body-ended-prematurely-error?</strong> <var class="def-var-arguments">obj</var><a class="copiable-link" href="#index-request_002dbody_002dended_002dprematurely_002derror_003f"> &para;</a></span></dt>
<dd><p>Return <code class="code">#t</code> if OBJ is a <code class="code">&amp;request-body-ended-prematurely</code>
exception.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-request_002dbody_002dport_002fknots"><span class="category-def">Procedure: </span><span><strong class="def-name">request-body-port/knots</strong> <var class="def-var-arguments">a</var><a class="copiable-link" href="#index-request_002dbody_002dport_002fknots"> &para;</a></span></dt>
<dd><p>Return an input port for reading the body of request REQUEST. Handles
chunked transfer encoding.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-run_002dknots_002dweb_002dserver"><span class="category-def">Procedure: </span><span><strong class="def-name">run-knots-web-server</strong> <var class="def-var-arguments">_ KEY: #:host #:family #:addr #:port #:socket #:read-request-exception-handler #:write-response-exception-handler #:connection-idle-timeout #:connection-buffer-size #:post-request-hook</var><a class="copiable-link" href="#index-run_002dknots_002dweb_002dserver"> &para;</a></span></dt>
<dd><p>Run the knots web server.
</p>
<p>HANDLER should be a procedure that takes one argument, the HTTP request
and returns two values, the response and response body.
</p>
<p>For example, here is a simple &quot;Hello, World!&quot; server:
</p>
<div class="example">
<pre class="example-preformatted"> (define (handler request)
(let ((body (read-request-body request)))
(values '((content-type . (text/plain)))
&quot;Hello, World!&quot;)))
(run-knots-web-server handler)
</pre></div>
<p>The response and body will be run through sanitize-response before
sending back to the client.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-sanitize_002dresponse"><span class="category-def">Procedure: </span><span><strong class="def-name">sanitize-response</strong> <var class="def-var-arguments">a b c</var><a class="copiable-link" href="#index-sanitize_002dresponse"> &para;</a></span></dt>
<dd><p>&quot;Sanitize&quot; the given response and body, making them appropriate for the
given request.
</p>
<p>As a convenience to web handler authors, RESPONSE may be given as an
alist of headers, in which case it is used to construct a default
response. Ensures that the response version corresponds to the request
version. If BODY is a string, encodes the string to a bytevector, in an
encoding appropriate for RESPONSE. Adds a content-length and
content-type header, as necessary.
</p>
<p>If BODY is a procedure, it is called with a port as an argument, and the
output collected as a bytevector. In the future we might try to instead
use a compressing, chunk-encoded port, and call this procedure later, in
the write-client procedure. Authors are advised not to rely on the
procedure being called at any particular time.
</p>
</dd></dl>
</div>
<div class="subsection-level-extent" id="Record-Types-5">
<h4 class="subsection"><span>1.11.3 Record Types<a class="copiable-link" href="#Record-Types-5"> &para;</a></span></h4>
<dl class="first-deftp">
<dt class="deftp" id="index-_0026request_002dbody_002dended_002dprematurely"><span class="category-def">Record type: </span><span><strong class="def-name">&amp;request-body-ended-prematurely</strong><a class="copiable-link" href="#index-_0026request_002dbody_002dended_002dprematurely"> &para;</a></span></dt>
<dd><p>This record type has the following fields:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">bytes-read</code></li></ul>
</dd></dl>
<hr>
</div>
</div>
<div class="section-level-extent" id="knots_005fweb">
<div class="nav-panel">
<p>
Previous: <a href="#knots_005fweb_002dserver" accesskey="p" rel="prev">(knots web-server)</a>, Up: <a href="#API" accesskey="u" rel="up">API</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="g_t_0028knots-web_0029"><span>1.12 (knots web)<a class="copiable-link" href="#g_t_0028knots-web_0029"> &para;</a></span></h3>
<ul class="mini-toc">
<li><a href="#Procedures-11" accesskey="1">Procedures</a></li>
</ul>
<div class="subsection-level-extent" id="Procedures-11">
<h4 class="subsection"><span>1.12.1 Procedures<a class="copiable-link" href="#Procedures-11"> &para;</a></span></h4>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002dcached_002dconnection"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-cached-connection</strong> <var class="def-var-arguments">_ _ KEY: #:close-connection-on-exception?</var><a class="copiable-link" href="#index-call_002dwith_002dcached_002dconnection"> &para;</a></span></dt>
<dd><p>Check out a connection port from CACHE and call <code class="code">(proc port)</code>,
returning the result. The port is returned to the cache when PROC
returns, or closed on exception if CLOSE-CONNECTION-ON-EXCEPTION? is
true (the default).
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-call_002dwith_002dconnection_002dcache"><span class="category-def">Procedure: </span><span><strong class="def-name">call-with-connection-cache</strong> <var class="def-var-arguments">_ _ _ KEY: #:verify-certificate?</var><a class="copiable-link" href="#index-call_002dwith_002dconnection_002dcache"> &para;</a></span></dt>
<dd><p>Create a connection cache for URI with up to MAX-CACHED-CONNECTIONS,
call <code class="code">(proc cache)</code>, then destroy the cache and return the values
returned by PROC.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-http_002dfold_002drequests"><span class="category-def">Procedure: </span><span><strong class="def-name">http-fold-requests</strong> <var class="def-var-arguments">_ _ _ _ KEY: #:batch-size</var><a class="copiable-link" href="#index-http_002dfold_002drequests"> &para;</a></span></dt>
<dd><p>Fold PROC over HTTP request/response pairs using CONNECTION-CACHE for
connections. PROC is called as <code class="code">(proc request response body-port
accumulator)</code> and its return value becomes the new accumulator. Requests
are sent in batches of up to BATCH-SIZE before responses are read (HTTP
pipelining).
</p>
<p>When the server closes the connection mid-batch the remaining requests
are retried on a fresh connection from the cache.
</p>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-make_002dconnection_002dcache"><span class="category-def">Procedure: </span><span><strong class="def-name">make-connection-cache</strong> <var class="def-var-arguments">_ _ KEY: #:verify-certificate?</var><a class="copiable-link" href="#index-make_002dconnection_002dcache"> &para;</a></span></dt>
<dd><p>Create a resource pool of up to MAX-CACHED-CONNECTIONS to URI.
</p>
</dd></dl>
<hr>
</div>
</div>
</div>
<div class="appendix-level-extent" id="Version-History">
<div class="nav-panel">
<p>
Next: <a href="#Copying-Information" accesskey="n" rel="next">Copying Information</a>, Previous: <a href="#API" accesskey="p" rel="prev">API</a>, Up: <a href="#Top" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h2 class="appendix" id="Version-History-1"><span>Appendix A Version History<a class="copiable-link" href="#Version-History-1"> &para;</a></span></h2>
<dl class="table">
<dt><em class="dfn">Version 0.Y.0, Month DD, 20YY</em></dt>
<dd><ul class="itemize mark-bullet">
<li>No initial release has yet been made.
</li></ul>
</dd>
</dl>
<hr>
</div>
<div class="appendix-level-extent" id="Copying-Information">
<div class="nav-panel">
<p>
Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previous: <a href="#Version-History" accesskey="p" rel="prev">Version History</a>, Up: <a href="#Top" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h2 class="appendix" id="Copying-Information-1"><span>Appendix B Copying Information<a class="copiable-link" href="#Copying-Information-1"> &para;</a></span></h2>
<p>Copyright © 2024, 2025 Christopher Baines &lt;mail@cbaines.net&gt;
</p>
<p>This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
</p>
<hr>
</div>
<div class="unnumbered-level-extent" id="Concept-Index">
<div class="nav-panel">
<p>
Next: <a href="#Data-Type-Index" accesskey="n" rel="next">Data Type Index</a>, Previous: <a href="#Copying-Information" accesskey="p" rel="prev">Copying Information</a>, Up: <a href="#Top" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h2 class="unnumbered" id="Concept-Index-1"><span>Concept Index<a class="copiable-link" href="#Concept-Index-1"> &para;</a></span></h2>
<hr>
</div>
<div class="unnumbered-level-extent" id="Data-Type-Index">
<div class="nav-panel">
<p>
Next: <a href="#Procedure-Index" accesskey="n" rel="next">Procedure Index</a>, Previous: <a href="#Concept-Index" accesskey="p" rel="prev">Concept Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h2 class="unnumbered" id="Data-Type-Index-1"><span>Data Type Index<a class="copiable-link" href="#Data-Type-Index-1"> &para;</a></span></h2>
<div class="printindex tp-printindex">
<table class="tp-entries-printindex" border="0">
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th class="sections-header-printindex">Section</th></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Data-Type-Index_tp_symbol-1">&amp;</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026knots_002dexception"><code>&amp;knots-exception</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026knots_002dexception-1"><code>&amp;knots-exception</code></a></td><td class="printindex-index-section"><a href="#knots_005fbacktraces">knots_backtraces</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026port_002dread_002dtimeout_002derror"><code>&amp;port-read-timeout-error</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026port_002dtimeout_002derror"><code>&amp;port-timeout-error</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026port_002dwrite_002dtimeout_002derror"><code>&amp;port-write-timeout-error</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026request_002dbody_002dended_002dprematurely"><code>&amp;request-body-ended-prematurely</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026resource_002dpool_002ddestroy_002dresource"><code>&amp;resource-pool-destroy-resource</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026resource_002dpool_002ddestroyed"><code>&amp;resource-pool-destroyed</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026resource_002dpool_002dtimeout"><code>&amp;resource-pool-timeout</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026resource_002dpool_002dtoo_002dmany_002dwaiters"><code>&amp;resource-pool-too-many-waiters</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-_0026thread_002dpool_002dtimeout_002derror"><code>&amp;thread-pool-timeout-error</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
</table>
</div>
<hr>
</div>
<div class="unnumbered-level-extent" id="Procedure-Index">
<div class="nav-panel">
<p>
Next: <a href="#Variable-Index" accesskey="n" rel="next">Variable Index</a>, Previous: <a href="#Data-Type-Index" accesskey="p" rel="prev">Data Type Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h2 class="unnumbered" id="Procedure-Index-1"><span>Procedure Index<a class="copiable-link" href="#Procedure-Index-1"> &para;</a></span></h2>
<div class="printindex fn-printindex">
<table class="fn-letters-header-printindex"><tr><th>Jump to: &nbsp; </th><td><a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-C"><b>C</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-D"><b>D</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-F"><b>F</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-H"><b>H</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-K"><b>K</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-M"><b>M</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-N"><b>N</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-P"><b>P</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-R"><b>R</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-S"><b>S</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-T"><b>T</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-W"><b>W</b></a>
&nbsp;
</td></tr></table>
<table class="fn-entries-printindex" border="0">
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th class="sections-header-printindex">Section</th></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-C">C</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002dcached_002dconnection"><code>call-with-cached-connection</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb">knots_web</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002dconnection_002dcache"><code>call-with-connection-cache</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb">knots_web</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002ddefault_002dio_002dwaiters"><code>call-with-default-io-waiters</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002dparallelism_002dlimiter"><code>call-with-parallelism-limiter</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002dresource_002dfrom_002dpool"><code>call-with-resource-from-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002dsigint"><code>call-with-sigint</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002dtemporary_002dthread"><code>call-with-temporary-thread</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dwith_002dthread"><code>call-with-thread</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-D">D</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-default_002dwrite_002dresponse_002dexception_002dhandler"><code>default-write-response-exception-handler</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-destroy_002dparallelism_002dlimiter"><code>destroy-parallelism-limiter</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-destroy_002dresource_002dpool"><code>destroy-resource-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-destroy_002dthread_002dpool"><code>destroy-thread-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-display_002fknots"><code>display/knots</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-F">F</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fiberize"><code>fiberize</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dbatch_002dfor_002deach"><code>fibers-batch-for-each</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dbatch_002dmap"><code>fibers-batch-map</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002ddelay"><code>fibers-delay</code></a></td><td class="printindex-index-section"><a href="#knots_005fpromise">knots_promise</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002ddelay_002feager"><code>fibers-delay/eager</code></a></td><td class="printindex-index-section"><a href="#knots_005fpromise">knots_promise</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dfor_002deach"><code>fibers-for-each</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dforce"><code>fibers-force</code></a></td><td class="printindex-index-section"><a href="#knots_005fpromise">knots_promise</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dlet"><code>fibers-let</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dmap"><code>fibers-map</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dmap_002dwith_002dprogress"><code>fibers-map-with-progress</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dparallel"><code>fibers-parallel</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dpromise_002dreset"><code>fibers-promise-reset</code></a></td><td class="printindex-index-section"><a href="#knots_005fpromise">knots_promise</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dpromise_002dresult_002davailable_003f"><code>fibers-promise-result-available?</code></a></td><td class="printindex-index-section"><a href="#knots_005fpromise">knots_promise</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dpromise_003f"><code>fibers-promise?</code></a></td><td class="printindex-index-section"><a href="#knots_005fpromise">knots_promise</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fibers_002dsort_0021"><code>fibers-sort!</code></a></td><td class="printindex-index-section"><a href="#knots_005fsort">knots_sort</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fixed_002dsize_002dthread_002dpool_002dchannel"><code>fixed-size-thread-pool-channel</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fixed_002dsize_002dthread_002dpool_002dcurrent_002dprocedures"><code>fixed-size-thread-pool-current-procedures</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-fixed_002dsize_002dthread_002dpool_003f"><code>fixed-size-thread-pool?</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-format_002fknots"><code>format/knots</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-H">H</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-http_002dfold_002drequests"><code>http-fold-requests</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb">knots_web</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-K">K</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-knots_002dexception_002dstack"><code>knots-exception-stack</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-knots_002dexception_002dstack-1"><code>knots-exception-stack</code></a></td><td class="printindex-index-section"><a href="#knots_005fbacktraces">knots_backtraces</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-knots_002dexception_003f"><code>knots-exception?</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-knots_002dexception_003f-1"><code>knots-exception?</code></a></td><td class="printindex-index-section"><a href="#knots_005fbacktraces">knots_backtraces</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-M">M</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dchunked_002doutput_002dport_002fknots"><code>make-chunked-output-port/knots</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dconnection_002dcache"><code>make-connection-cache</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb">knots_web</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dfixed_002dsize_002dresource_002dpool"><code>make-fixed-size-resource-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dfixed_002dsize_002dthread_002dpool"><code>make-fixed-size-thread-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dknots_002dexception"><code>make-knots-exception</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dknots_002dexception-1"><code>make-knots-exception</code></a></td><td class="printindex-index-section"><a href="#knots_005fbacktraces">knots_backtraces</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dparallelism_002dlimiter"><code>make-parallelism-limiter</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dresource_002dpool"><code>make-resource-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dresource_002dpool_002ddestroy_002dresource_002dexception"><code>make-resource-pool-destroy-resource-exception</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-make_002dthread_002dpool"><code>make-thread-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-N">N</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-non_002dblocking_002dopen_002dsocket_002dfor_002duri"><code>non-blocking-open-socket-for-uri</code></a></td><td class="printindex-index-section"><a href="#knots_005fnon_002dblocking">knots_non-blocking</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-non_002dblocking_002dport"><code>non-blocking-port</code></a></td><td class="printindex-index-section"><a href="#knots_005fnon_002dblocking">knots_non-blocking</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-P">P</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-parallelism_002dlimiter_003f"><code>parallelism-limiter?</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-port_002dread_002dtimeout_002derror_003f"><code>port-read-timeout-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-port_002dtimeout_002derror_003f"><code>port-timeout-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-port_002dwrite_002dtimeout_002derror_003f"><code>port-write-timeout-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-print_002dbacktrace_002dand_002dexception_002fknots"><code>print-backtrace-and-exception/knots</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-print_002dbacktrace_002dand_002dexception_002fknots-1"><code>print-backtrace-and-exception/knots</code></a></td><td class="printindex-index-section"><a href="#knots_005fbacktraces">knots_backtraces</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-R">R</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-read_002drequest_002dbody_002fknots"><code>read-request-body/knots</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-request_002dbody_002dended_002dprematurely_002derror_003f"><code>request-body-ended-prematurely-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-request_002dbody_002dport_002fknots"><code>request-body-port/knots</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dchannel"><code>resource-pool-channel</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dconfiguration"><code>resource-pool-configuration</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002ddestroy_002dresource_002dexception_003f"><code>resource-pool-destroy-resource-exception?</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002ddestroyed_002derror_002dpool"><code>resource-pool-destroyed-error-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002ddestroyed_002derror_003f"><code>resource-pool-destroyed-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dname"><code>resource-pool-name</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dstats"><code>resource-pool-stats</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dtimeout_002derror_002dpool"><code>resource-pool-timeout-error-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dtimeout_002derror_003f"><code>resource-pool-timeout-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_002dpool"><code>resource-pool-too-many-waiters-error-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_002dwaiters_002dcount"><code>resource-pool-too-many-waiters-error-waiters-count</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002dtoo_002dmany_002dwaiters_002derror_003f"><code>resource-pool-too-many-waiters-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_003f"><code>resource-pool?</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-run_002dknots_002dweb_002dserver"><code>run-knots-web-server</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-S">S</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-sanitize_002dresponse"><code>sanitize-response</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-set_002dthread_002dname"><code>set-thread-name</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-simple_002dformat_002fknots"><code>simple-format/knots</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-spawn_002dfiber_002fknots"><code>spawn-fiber/knots</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-spawn_002dqueueing_002dfiber"><code>spawn-queueing-fiber</code></a></td><td class="printindex-index-section"><a href="#knots_005fqueue">knots_queue</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-T">T</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-thread_002dname"><code>thread-name</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-thread_002dpool_002darguments_002dparameter"><code>thread-pool-arguments-parameter</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-thread_002dpool_002ddefault_002dcheckout_002dtimeout"><code>thread-pool-default-checkout-timeout</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-thread_002dpool_002dresource_002dpool"><code>thread-pool-resource-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-thread_002dpool_002dtimeout_002derror_002dpool"><code>thread-pool-timeout-error-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-thread_002dpool_002dtimeout_002derror_003f"><code>thread-pool-timeout-error?</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-thread_002dpool_003f"><code>thread-pool?</code></a></td><td class="printindex-index-section"><a href="#knots_005fthread_002dpool">knots_thread-pool</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Procedure-Index_fn_letter-W">W</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-wait_002duntil_002dport_002dreadable_002doperation"><code>wait-until-port-readable-operation</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-wait_002duntil_002dport_002dwritable_002doperation"><code>wait-until-port-writable-operation</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-wait_002dwhen_002dsystem_002dclock_002dbehind"><code>wait-when-system-clock-behind</code></a></td><td class="printindex-index-section"><a href="#knots">knots</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-web_002dserver_002dport"><code>web-server-port</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-web_002dserver_002dsocket"><code>web-server-socket</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-web_002dserver_003f"><code>web-server?</code></a></td><td class="printindex-index-section"><a href="#knots_005fweb_002dserver">knots_web-server</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-with_002dfibers_002dtimeout"><code>with-fibers-timeout</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-with_002dparallelism_002dlimiter"><code>with-parallelism-limiter</code></a></td><td class="printindex-index-section"><a href="#knots_005fparallelism">knots_parallelism</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-with_002dport_002dtimeouts"><code>with-port-timeouts</code></a></td><td class="printindex-index-section"><a href="#knots_005ftimeout">knots_timeout</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-with_002dresource_002dfrom_002dpool"><code>with-resource-from-pool</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
</table>
<table class="fn-letters-footer-printindex"><tr><th>Jump to: &nbsp; </th><td><a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-C"><b>C</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-D"><b>D</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-F"><b>F</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-H"><b>H</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-K"><b>K</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-M"><b>M</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-N"><b>N</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-P"><b>P</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-R"><b>R</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-S"><b>S</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-T"><b>T</b></a>
&nbsp;
<a class="summary-letter-printindex" href="#Procedure-Index_fn_letter-W"><b>W</b></a>
&nbsp;
</td></tr></table>
</div>
<hr>
</div>
<div class="unnumbered-level-extent" id="Variable-Index">
<div class="nav-panel">
<p>
Previous: <a href="#Procedure-Index" accesskey="p" rel="prev">Procedure Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h2 class="unnumbered" id="Variable-Index-1"><span>Variable Index<a class="copiable-link" href="#Variable-Index-1"> &para;</a></span></h2>
<div class="printindex vr-printindex">
<table class="vr-entries-printindex" border="0">
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th class="sections-header-printindex">Section</th></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><th id="Variable-Index_vr_letter-R">R</th></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-resource_002dpool_002ddefault_002dtimeout_002dhandler"><code>resource-pool-default-timeout-handler</code></a></td><td class="printindex-index-section"><a href="#knots_005fresource_002dpool">knots_resource-pool</a></td></tr>
<tr><td colspan="3"><hr></td></tr>
</table>
</div>
</div>
</div>
</body>
</html>