TUPLE: macosx-monitor ;
: enqueue-notifications ( triples monitor -- )
- monitor-queue [
- [ first { +modify-file+ } swap changed-file ] each
- ] bind ;
+ tuck monitor-queue
+ [ [ first { +modify-file+ } swap changed-file ] each ] bind
+ notify-callback ;
M: macosx-io <monitor>
drop
M: macosx-monitor dispose
dup simple-monitor-handle dispose delegate dispose ;
-
-USING: threads io.files io.monitors init kernel tools.browser ;\r
+USING: threads io.files io.monitors init kernel tools.browser\r
+continuations ;\r
IN: vocabs.monitor\r
\r
! Use file system change monitoring to flush the tags/authors\r
dup next-change 2drop reset-cache update-thread ;\r
\r
: start-update-thread\r
+ #! Silently ignore errors during monitor creation since\r
+ #! monitors are not supported on all platforms.\r
[\r
- "" resource-path t <monitor> update-thread\r
+ [ "" resource-path t <monitor> ] [ drop f ] recover\r
+ [ update-thread ] when*\r
] in-thread ;\r
\r
[ start-update-thread ] "tools.browser" add-init-hook\r