convert Watcher thread to Assistant monad

This is a nice win; much less code runs in Annex, so other threads have
more chances to run concurrently.

I do notice that renaming a file has gone from 1 to 2 commits. I think this
is due to the above improvement letting the committer run more frequently,
so it commits the rm first.
This commit is contained in:
Joey Hess 2012-10-29 09:55:40 -04:00
parent 4dbdc2b666
commit bad88e404a
4 changed files with 89 additions and 88 deletions

View file

@ -90,9 +90,5 @@ check = do
dstatus <- getAssistant daemonStatusHandle
liftIO $ void $ addAlert dstatus $ sanityCheckFixAlert msg
addsymlink file s = do
d <- getAssistant id
liftIO $ Watcher.runHandler (threadName d)
(threadState d) (daemonStatusHandle d)
(transferQueue d) (changeChan d)
Watcher.onAddSymlink file s
Watcher.runHandler Watcher.onAddSymlink file s
insanity $ "found unstaged symlink: " ++ file