]> gitweb.factorcode.org Git - factor.git/blob - basis/furnace/alloy/alloy-docs.factor
Merge branch 'master' into experimental (untested!)
[factor.git] / basis / furnace / alloy / alloy-docs.factor
1 IN: furnace.alloy
2 USING: help.markup help.syntax db multiline ;
3
4 HELP: init-furnace-tables
5 { $description "Initializes database tables used by asides, conversations and session management. This word must be invoked inside a " { $link with-db } " scope." } ;
6
7 HELP: <alloy>
8 { $values { "responder" "a responder" } { "db" db } { "responder'" "an alloy responder" } }
9 { $description "Wraps the responder with support for asides, conversations, sessions and database persistence." }
10 { $examples
11     "The " { $vocab-link "webapps.counter" } " vocabulary uses an alloy to configure the counter:"
12     { $code
13         <" : counter-db ( -- db ) "counter.db" <sqlite-db> ;
14
15 : run-counter ( -- )
16     <counter-app>
17         counter-db <alloy>
18         main-responder set-global
19     8080 httpd ;">
20     }
21 } ;
22
23 HELP: start-expiring
24 { $values { "db" db } }
25 { $description "Starts a timer which expires old session state from the given database." } ;
26
27 ARTICLE: "furnace.alloy" "Furnace alloy responder"
28 "The " { $vocab-link "furnace.alloy" } " vocabulary implements a convenience responder which combines several Furnace features into one easy-to-use wrapper:"
29 { $list
30     { $link "furnace.asides" }
31     { $link "furnace.conversations" }
32     { $link "furnace.sessions" }
33     { $link "furnace.db" }
34 }
35 "A word to wrap a responder in an alloy:"
36 { $subsection <alloy> }
37 "Initializing database tables for asides, conversations and sessions:"
38 { $subsection init-furnace-tables }
39 "Start a timer to expire asides, conversations and sessions:"
40 { $subsection start-expiring } ;
41
42 ABOUT: "furnace.alloy"