2009-09-20 23:42:40 -04:00
USING: help.markup help.syntax db ;
2008-11-14 00:21:32 -05:00
IN: furnace.alloy
HELP: init-furnace-tables
{ $description "Initializes database tables used by asides, conversations and session management. This word must be invoked inside a " { $link with-db } " scope." } ;
HELP: <alloy>
2008-12-18 00:35:46 -05:00
{ $values { "responder" "a responder" } { "db" "a database descriptor" } { "responder'" "an alloy responder" } }
2008-11-14 00:21:32 -05:00
{ $description "Wraps the responder with support for asides, conversations, sessions and database persistence." }
{ $examples
"The " { $vocab-link "webapps.counter" } " vocabulary uses an alloy to configure the counter:"
{ $code
2009-09-20 23:42:40 -04:00
"" ": counter-db ( -- db ) " counter.db" <sqlite-db> ;
2008-11-14 00:21:32 -05:00
: run-counter ( -- )
<counter-app>
counter-db <alloy>
main-responder set-global
2009-09-20 23:42:40 -04:00
8080 httpd ;"""
2008-11-14 00:21:32 -05:00
}
} ;
HELP: start-expiring
2008-12-18 00:35:46 -05:00
{ $values { "db" "a database descriptor" } }
2008-11-14 00:21:32 -05:00
{ $description "Starts a timer which expires old session state from the given database." } ;
ARTICLE: "furnace.alloy" "Furnace alloy responder"
"The " { $vocab-link "furnace.alloy" } " vocabulary implements a convenience responder which combines several Furnace features into one easy-to-use wrapper:"
{ $list
{ $link "furnace.asides" }
{ $link "furnace.conversations" }
{ $link "furnace.sessions" }
{ $link "furnace.db" }
}
"A word to wrap a responder in an alloy:"
2009-10-01 15:56:36 -04:00
{ $subsections <alloy> }
2008-11-14 00:21:32 -05:00
"Initializing database tables for asides, conversations and sessions:"
2009-10-01 15:56:36 -04:00
{ $subsections init-furnace-tables }
2008-11-14 00:21:32 -05:00
"Start a timer to expire asides, conversations and sessions:"
2009-10-01 15:56:36 -04:00
{ $subsections start-expiring } ;
2008-11-14 00:21:32 -05:00
ABOUT: "furnace.alloy"