2 USING: help.markup help.syntax math kernel calendar ;
\r
5 { $values { "obj" object } { "dt/f" { $maybe duration } } }
\r
6 { $contract "Outputs an object's timeout." } ;
\r
9 { $values { "dt/f" { $maybe duration } } { "obj" object } }
\r
10 { $contract "Sets an object's timeout." } ;
\r
12 HELP: cancel-operation
\r
13 { $values { "obj" object } }
\r
14 { $contract "Handles a timeout, usually by waking up all threads waiting on the object." } ;
\r
17 { $values { "obj" object } { "quot" { $quotation "( obj -- )" } } }
\r
18 { $description "Applies the quotation to the object. If the object's timeout expires before the quotation returns, " { $link cancel-operation } " is called on the object." } ;
\r
20 ARTICLE: "io.timeouts" "I/O timeout protocol"
\r
21 "Streams, processes and monitors support optional timeouts, which impose an upper bound on the length of time for which an operation on these objects can block. Timeouts are used in network servers to prevent malicious clients from holding onto connections forever, and to ensure that runaway processes get killed."
\r
22 { $subsection timeout }
\r
23 { $subsection set-timeout }
\r
24 "The I/O timeout protocol can be implemented by any class wishing to support timeouts on blocking operations."
\r
25 { $subsection cancel-operation }
\r
26 "A combinator to be used in operations which can time out:"
\r
27 { $subsection with-timeout }
\r
28 { $see-also "stream-protocol" "io.launcher" "io.monitors" } ;
\r
30 ABOUT: "io.timeouts"
\r