]> gitweb.factorcode.org Git - factor.git/blob - extra/alarms/alarms-docs.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / alarms / alarms-docs.factor
1 IN: alarms\r
2 USING: help.markup help.syntax calendar quotations ;\r
3 \r
4 HELP: alarm\r
5 { $class-description "An alarm. Can be passed to " { $link cancel-alarm } "." } ;\r
6 \r
7 HELP: add-alarm\r
8 { $values { "quot" quotation } { "time" timestamp } { "frequency" "a " { $link duration } " or " { $link f } } { "alarm" alarm } }\r
9 { $description "Creates and registers an alarm. If " { $snippet "frequency" } " is " { $link f } ", this will be a one-time alarm, otherwise it will fire with the given frequency. The quotation will be called from the alarm thread." } ;\r
10 \r
11 HELP: later\r
12 { $values { "quot" quotation } { "dt" duration } { "alarm" alarm } }\r
13 { $description "Creates and registers an alarm which calls the quotation once at " { $snippet "time" } " from now." } ;\r
14 \r
15 HELP: cancel-alarm\r
16 { $values { "alarm" alarm } }\r
17 { $description "Cancels an alarm. Does nothing if the alarm is not active." } ;\r
18 \r
19 ARTICLE: "alarms" "Alarms"\r
20 "Alarms provide a lightweight way to schedule one-time and recurring tasks without spawning a new thread."\r
21 { $subsection alarm }\r
22 { $subsection add-alarm }\r
23 { $subsection later }\r
24 { $subsection cancel-alarm }\r
25 "Alarms do not persist across image saves. Saving and restoring an image has the effect of calling " { $link cancel-alarm } " on all " { $link alarm } " instances." ;\r
26 \r
27 ABOUT: "alarms"\r