Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
destroy hub
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Turner committed Apr 13, 2011
1 parent e9532c2 commit 4de91d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Database/Redis/SubHub.hs
Expand Up @@ -105,8 +105,10 @@ hubloop sh@(SubHub host port state) tm = do
)
else (do
let submap' = M.update (\l -> Just $ filter (\(i,_)-> i/=id) l) nkey submap
when ((M.member nkey submap') && (length (submap' ! nkey) == 0)) $ issueUnSubCommand s nkey
addSubs s newsubs submap'
let empty = ((M.member nkey submap') && (length (submap' ! nkey) == 0))
when empty $ issueUnSubCommand s nkey
let submap'' = if empty then M.delete nkey submap' else submap'
addSubs s newsubs submap''
)
)

Expand Down Expand Up @@ -149,8 +151,8 @@ withsub s keys a =
bracket (sub s keys) (unsub s) a

destroySubHub :: SubHub -> IO ()
destroySubHub = undefined

destroySubHub (SubHub _ _ (_, trunning)) = do
atomically $ writeTVar trunning False

{-
-
Expand Down

0 comments on commit 4de91d3

Please sign in to comment.