summaryrefslogtreecommitdiff
path: root/Assistant/Types/NetMessager.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-03 14:16:17 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-03 14:16:17 -0400
commit1279d72b4e4fe77abb983954dc937021559d4169 (patch)
tree6c7d718be97634ddaaa2a9dd90637363cc0ebeb0 /Assistant/Types/NetMessager.hs
parent85eb13a57a7c0c4f2df46ab4c01c434585370999 (diff)
refactor XMPP client
Diffstat (limited to 'Assistant/Types/NetMessager.hs')
-rw-r--r--Assistant/Types/NetMessager.hs31
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