diff options
Diffstat (limited to 'stdlib/source/library/lux/world/file/watch.lux')
-rw-r--r-- | stdlib/source/library/lux/world/file/watch.lux | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux index f9229b17c..e3d26e30c 100644 --- a/stdlib/source/library/lux/world/file/watch.lux +++ b/stdlib/source/library/lux/world/file/watch.lux @@ -8,6 +8,7 @@ ["." monad (#+ do)]] [control ["." io (#+ IO)] + ["." maybe] ["." try (#+ Try)] ["." exception (#+ exception:)] [concurrency @@ -15,7 +16,6 @@ ["." stm (#+ STM Var)]]] [data ["." product] - ["." maybe] ["." text ["%" format (#+ format)]] [collection @@ -33,7 +33,7 @@ ["." //]) (abstract: .public Concern - {} + {#.doc (example "A particular concern to watch-out for.")} {#create Bit #modify Bit @@ -83,6 +83,8 @@ ) (interface: .public (Watcher !) + {#.doc (example "Machinery for watching a file-system for changes to files and directories.")} + (: (-> Concern //.Path (! (Try Any))) start) (: (-> //.Path (! (Try Concern))) @@ -185,6 +187,8 @@ deletions]]))) (def: .public (polling fs) + {#.doc (example "A simple watcher that works for any file-system." + "Polls files and directories to detect changes.")} (-> (//.System Async) (Watcher Async)) (let [tracker (: (Var Directory_Tracker) (stm.var (dictionary.empty text.hash)))] @@ -257,6 +261,8 @@ ))) (def: .public (mock separator) + {#.doc (example "A fake/emulated watcher." + "Must be given a path separator for the file-system.")} (-> Text [(//.System Async) (Watcher Async)]) (let [fs (//.mock separator)] [fs @@ -408,6 +414,7 @@ )) (def: .public default + {#.doc (example "The default watcher for the default file-system.")} (IO (Try (Watcher Async))) (do (try.with io.monad) [watcher (java/nio/file/FileSystem::newWatchService |