diff options
Diffstat (limited to 'Assistant/Types/NetMessager.hs')
-rw-r--r-- | Assistant/Types/NetMessager.hs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Assistant/Types/NetMessager.hs b/Assistant/Types/NetMessager.hs new file mode 100644 index 000000000..fea88a53a --- /dev/null +++ b/Assistant/Types/NetMessager.hs @@ -0,0 +1,31 @@ +{- git-annex assistant out of band network messager types + - + - Copyright 2012 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Assistant.Types.NetMessager where + +import Common.Annex + +import Control.Concurrent.STM +import Control.Concurrent.MSampleVar + +{- Messages that can be sent out of band by a network messager. -} +data NetMessage = NotifyPush [UUID] + +{- Controls for the XMPP client. + - + - It can be fed XMPP messages to send. + - + - It can also be sent a signal when it should restart for some reason. -} +data NetMessagerControl = NetMessagerControl + { netMessages :: TChan (NetMessage) + , netMessagerRestart :: MSampleVar () + } + +newNetMessagerControl :: IO NetMessagerControl +newNetMessagerControl = NetMessagerControl + <$> atomically newTChan + <*> newEmptySV |