diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-08 14:06:43 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-08 14:06:43 -0400 |
commit | e146cc372b8daa70fa093c9f27cedf7188ce72fc (patch) | |
tree | e5fb8aa7619fd4d3c4129f4f6f21b728cb6d3e4c /Assistant | |
parent | 7466500782b89ea4d1aa038b8243268e8e261821 (diff) |
rename
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/Monad.hs | 4 | ||||
-rw-r--r-- | Assistant/NetMessager.hs | 8 | ||||
-rw-r--r-- | Assistant/Types/NetMessager.hs | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Assistant/Monad.hs b/Assistant/Monad.hs index 3b6dfedee..a676bc8fb 100644 --- a/Assistant/Monad.hs +++ b/Assistant/Monad.hs @@ -61,7 +61,7 @@ data AssistantData = AssistantData , changeChan :: ChangeChan , branchChangeHandle :: BranchChangeHandle , buddyList :: BuddyList - , netMessagerControl :: NetMessagerControl + , netMessager :: NetMessager } newAssistantData :: ThreadState -> DaemonStatusHandle -> IO AssistantData @@ -77,7 +77,7 @@ newAssistantData st dstatus = AssistantData <*> newChangeChan <*> newBranchChangeHandle <*> newBuddyList - <*> newNetMessagerControl + <*> newNetMessager runAssistant :: AssistantData -> Assistant a -> IO a runAssistant d a = runReaderT (mkAssistant a) d diff --git a/Assistant/NetMessager.hs b/Assistant/NetMessager.hs index 08490e005..8895cb7db 100644 --- a/Assistant/NetMessager.hs +++ b/Assistant/NetMessager.hs @@ -15,14 +15,14 @@ import Control.Concurrent.MSampleVar sendNetMessage :: NetMessage -> Assistant () sendNetMessage m = - (atomically . flip writeTChan m) <<~ (netMessages . netMessagerControl) + (atomically . flip writeTChan m) <<~ (netMessages . netMessager) waitNetMessage :: Assistant (NetMessage) -waitNetMessage = (atomically . readTChan) <<~ (netMessages . netMessagerControl) +waitNetMessage = (atomically . readTChan) <<~ (netMessages . netMessager) notifyNetMessagerRestart :: Assistant () notifyNetMessagerRestart = - flip writeSV () <<~ (netMessagerRestart . netMessagerControl) + flip writeSV () <<~ (netMessagerRestart . netMessager) waitNetMessagerRestart :: Assistant () -waitNetMessagerRestart = readSV <<~ (netMessagerRestart . netMessagerControl) +waitNetMessagerRestart = readSV <<~ (netMessagerRestart . netMessager) diff --git a/Assistant/Types/NetMessager.hs b/Assistant/Types/NetMessager.hs index 163468744..77f2759b3 100644 --- a/Assistant/Types/NetMessager.hs +++ b/Assistant/Types/NetMessager.hs @@ -39,12 +39,12 @@ data NetMessage {- Something used to identify a specific client to send the message to. -} type ClientID = Text -data NetMessagerControl = NetMessagerControl +data NetMessager = NetMessager { netMessages :: TChan (NetMessage) , netMessagerRestart :: MSampleVar () } -newNetMessagerControl :: IO NetMessagerControl -newNetMessagerControl = NetMessagerControl +newNetMessager :: IO NetMessager +newNetMessager = NetMessager <$> atomically newTChan <*> newEmptySV |