refactor ref change watching
authorJoey Hess <joeyh@joeyh.name>
Fri, 9 Dec 2016 18:52:38 +0000 (14:52 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 9 Dec 2016 19:01:09 +0000 (15:01 -0400)
commite152c322f8d7a2430636f26aa55272773ea1c9da
treeed19e7c2894405ef941b564026846d92c6eaec8d
parent596e1685a6aaaff0fdb32d6f1f991f4749bfbe1b
refactor ref change watching

Added to change notification to P2P protocol.

Switched to a TBChan so that a single long-running thread can be
started, and serve perhaps intermittent requests for change
notifications, without buffering all changes in memory.

The P2P runner currently starts up a new thread each times it waits
for a change, but that should allow later reusing a thread. Although
each connection from a peer will still need a new watcher thread to run.

The dependency on stm-chans is more or less free; some stuff in yesod
uses it, so it was already indirectly pulled in when building with the
webapp.

This commit was sponsored by Francois Marier on Patreon.
Annex/ChangedRefs.hs [new file with mode: 0644]
Command/NotifyChanges.hs
P2P/Annex.hs
P2P/Protocol.hs
RemoteDaemon/Transport/Ssh.hs
RemoteDaemon/Transport/Ssh/Types.hs
RemoteDaemon/Types.hs
debian/control
git-annex.cabal