refactor XMPP client

This commit is contained in:
Joey Hess 2012-11-03 14:16:17 -04:00
parent 74385e3d38
commit a1228e27ed
12 changed files with 291 additions and 175 deletions

View file

@ -9,10 +9,8 @@ module Assistant.Pushes where
import Assistant.Common
import Assistant.Types.Pushes
import Utility.TSet
import Control.Concurrent.STM
import Control.Concurrent.MSampleVar
import Data.Time.Clock
import qualified Data.Map as M
@ -40,15 +38,3 @@ changeFailedPushMap a = do
store v m
| m == M.empty = noop
| otherwise = putTMVar v $! m
notifyPush :: [UUID] -> Assistant ()
notifyPush us = flip putTSet us <<~ (pushNotifierSuccesses . pushNotifier)
waitPush :: Assistant [UUID]
waitPush = getTSet <<~ (pushNotifierSuccesses . pushNotifier)
notifyRestart :: Assistant ()
notifyRestart = flip writeSV () <<~ (pushNotifierWaiter . pushNotifier)
waitRestart :: Assistant ()
waitRestart = readSV <<~ (pushNotifierWaiter . pushNotifier)