summaryrefslogtreecommitdiff
path: root/src/Network/KRPC/Manager.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-19 05:16:09 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-19 05:16:09 +0400
commit9dda7109e1877821612488602cbea3014a3e8566 (patch)
tree42e5973765a3653b91ef46ae43689841b7a46aa5 /src/Network/KRPC/Manager.hs
parent41ca2fc6ece3e24542703035c4249f409eca3906 (diff)
Add function isActive
Diffstat (limited to 'src/Network/KRPC/Manager.hs')
-rw-r--r--src/Network/KRPC/Manager.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Network/KRPC/Manager.hs b/src/Network/KRPC/Manager.hs
index e0ea9618..4436a9ba 100644
--- a/src/Network/KRPC/Manager.hs
+++ b/src/Network/KRPC/Manager.hs
@@ -24,6 +24,7 @@ module Network.KRPC.Manager
24 , newManager 24 , newManager
25 , closeManager 25 , closeManager
26 , withManager 26 , withManager
27 , isActive
27 , listen 28 , listen
28 29
29 -- * Queries 30 -- * Queries
@@ -192,6 +193,12 @@ closeManager Manager {..} = do
192 -- TODO unblock calls 193 -- TODO unblock calls
193 close sock 194 close sock
194 195
196-- | Check if the manager is still active. Manager becomes active
197-- until 'closeManager' called.
198isActive :: Manager m -> IO Bool
199isActive Manager {..} = liftIO $ isBound sock
200{-# INLINE isActive #-}
201
195-- | Normally you should use Control.Monad.Trans.Resource.allocate 202-- | Normally you should use Control.Monad.Trans.Resource.allocate
196-- function. 203-- function.
197withManager :: Options -> SockAddr -> [Handler h] 204withManager :: Options -> SockAddr -> [Handler h]