diff options
Diffstat (limited to 'stdlib/source/library/lux/world/file/watch.lux')
-rw-r--r-- | stdlib/source/library/lux/world/file/watch.lux | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux index 0bbc37e35..3a0b98f86 100644 --- a/stdlib/source/library/lux/world/file/watch.lux +++ b/stdlib/source/library/lux/world/file/watch.lux @@ -198,17 +198,17 @@ [exists? (\ fs directory? path)] (if exists? (do ! - [updated? (stm.commit (..update_watch! new_concern path tracker))] + [updated? (stm.commit! (..update_watch! new_concern path tracker))] (if updated? (in (#try.Success [])) (do (try.with !) [file_tracker (..file_tracker fs path)] (do ! - [_ (stm.commit (stm.update (dictionary.has path [new_concern file_tracker]) tracker))] + [_ (stm.commit! (stm.update (dictionary.has path [new_concern file_tracker]) tracker))] (in (#try.Success [])))))) (in (exception.except ..cannot_poll_a_non_existent_directory [path]))))) (def: (concern path) - (stm.commit + (stm.commit! (do stm.monad [@tracker (stm.read tracker)] (in (case (dictionary.value path @tracker) @@ -218,7 +218,7 @@ #.None (exception.except ..not_being_watched [path])))))) (def: (stop path) - (stm.commit + (stm.commit! (do {! stm.monad} [@tracker (stm.read tracker)] (case (dictionary.value path @tracker) @@ -231,16 +231,16 @@ (in (exception.except ..not_being_watched [path])))))) (def: (poll _) (do async.monad - [@tracker (stm.commit (stm.read tracker))] + [@tracker (stm.commit! (stm.read tracker))] (do {! (try.with async.monad)} [changes (|> @tracker dictionary.entries (monad.map ! (..available_directory_changes fs))) _ (do async.monad - [_ (stm.commit (stm.write (|> changes - (list\map product.left) - (dictionary.of_list text.hash)) - tracker))] + [_ (stm.commit! (stm.write (|> changes + (list\map product.left) + (dictionary.of_list text.hash)) + tracker))] (in (#try.Success []))) .let [[creations modifications deletions] (list\fold (function (_ [_ [creations modifications deletions]] @@ -425,13 +425,13 @@ stop (: (-> //.Path (Async (Try Concern))) (function (_ path) (do {! async.monad} - [@tracker (stm.commit (stm.read tracker))] + [@tracker (stm.commit! (stm.read tracker))] (case (dictionary.value path @tracker) (#.Some [concern key]) (do ! [_ (async.future (java/nio/file/WatchKey::cancel key)) - _ (stm.commit (stm.update (dictionary.lacks path) tracker))] + _ (stm.commit! (stm.update (dictionary.lacks path) tracker))] (in (#try.Success concern))) #.None @@ -447,11 +447,11 @@ watcher path)] (do async.monad - [_ (stm.commit (stm.update (dictionary.has path [concern key]) tracker))] + [_ (stm.commit! (stm.update (dictionary.has path [concern key]) tracker))] (in (#try.Success [])))))) (def: (concern path) (do async.monad - [@tracker (stm.commit (stm.read tracker))] + [@tracker (stm.commit! (stm.read tracker))] (case (dictionary.value path @tracker) (#.Some [concern key]) (in (#try.Success concern)) |