factor/extra/vocabs/monitor/monitor.factor

23 lines
755 B
Factor
Raw Normal View History

2008-02-18 08:30:16 -05:00
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: threads io.files io.monitors init kernel
tools.browser namespaces continuations ;
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 08:30:16 -05:00
SYMBOL: vocab-monitor
2008-02-05 19:55:10 -05:00
2008-02-18 06:07:40 -05:00
: monitor-thread ( -- )
2008-02-18 08:30:16 -05:00
vocab-monitor get-global next-change 2drop reset-cache ;
2008-02-18 06:07:40 -05:00
: 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 08:30:16 -05:00
[
"" resource-path t <monitor> vocab-monitor set-global
[ monitor-thread t ] "Vocabulary monitor" spawn-server drop
] [ drop ] recover ;
2008-02-05 19:55:10 -05:00
2008-02-18 06:07:40 -05:00
[ start-monitor-thread ] "vocabs.monitor" add-init-hook