factor/extra/vocabs/monitor/monitor.factor

19 lines
602 B
Factor
Raw Normal View History

2008-02-18 06:07:40 -05:00
USING: concurrency.threads io.files io.monitors init kernel
tools.browser ;
2008-02-05 19:55:10 -05:00
IN: vocabs.monitor
! Use file system change monitoring to flush the tags/authors
! cache
2008-02-18 06:07:40 -05:00
: (monitor-thread) ( monitor -- )
dup next-change 2drop reset-cache (monitor-thread) ;
2008-02-05 19:55:10 -05:00
2008-02-18 06:07:40 -05:00
: monitor-thread ( -- )
"" resource-path t <monitor> (monitor-thread) ;
: start-monitor-thread
2008-02-12 13:19:25 -05:00
#! Silently ignore errors during monitor creation since
#! monitors are not supported on all platforms.
2008-02-18 06:07:40 -05:00
[ monitor-thread ] "Vocabulary monitor" spawn drop ;
2008-02-05 19:55:10 -05:00
2008-02-18 06:07:40 -05:00
[ start-monitor-thread ] "vocabs.monitor" add-init-hook