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
|
2008-02-29 20:10:30 -05:00
|
|
|
tools.browser namespaces continuations vocabs.loader ;
|
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-29 20:10:30 -05:00
|
|
|
vocab-monitor get-global
|
|
|
|
next-change 2drop
|
|
|
|
t sources-changed? set-global 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
|
2008-02-26 15:58:02 -05:00
|
|
|
] ignore-errors ;
|
2008-02-05 19:55:10 -05:00
|
|
|
|
2008-02-18 06:07:40 -05:00
|
|
|
[ start-monitor-thread ] "vocabs.monitor" add-init-hook
|