factor/extra/io/timeouts/timeouts-docs.factor

32 lines
1.5 KiB
Factor
Raw Normal View History

2008-02-09 23:28:22 -05:00
IN: io.timeouts
2008-02-21 20:12:55 -05:00
USING: help.markup help.syntax math kernel calendar ;
2008-02-09 23:28:22 -05:00
2008-02-21 20:12:55 -05:00
HELP: timeout
{ $values { "obj" object } { "dt/f" "a " { $link dt } " or " { $link f } } }
{ $contract "Outputs an object's timeout." } ;
2008-02-09 23:28:22 -05:00
HELP: set-timeout
2008-02-21 20:12:55 -05:00
{ $values { "dt/f" "a " { $link dt } " or " { $link f } } { "obj" object } }
{ $contract "Sets an object's timeout." } ;
2008-02-09 23:28:22 -05:00
HELP: timed-out
{ $values { "obj" object } }
{ $contract "Handles a timeout, usually by waking up all threads waiting on the object." } ;
HELP: with-timeout
{ $values { "obj" object } { "quot" "a quotation with stack effect " { $snippet "( obj -- )" } } }
{ $description "Applies the quotation to the object. If the object's timeout expires before the quotation returns, " { $link timed-out } " is called on the object." } ;
ARTICLE: "io.timeouts" "I/O timeout protocol"
"Streams and processes 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."
2008-02-21 20:12:55 -05:00
{ $subsection timeout }
2008-02-09 23:28:22 -05:00
{ $subsection set-timeout }
"The I/O timeout protocol can be implemented by any class wishing to support timeouts on blocking operations."
{ $subsection timed-out }
"A combinator to be used in operations which can time out:"
{ $subsection with-timeout }
{ $see-also "stream-protocol" "io.launcher" }
;
ABOUT: "io.timeouts"