summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Exchange/Session.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Session.hs')
-rw-r--r--src/Network/BitTorrent/Exchange/Session.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Exchange/Session.hs b/src/Network/BitTorrent/Exchange/Session.hs
index 8c3d5388..32f8eabd 100644
--- a/src/Network/BitTorrent/Exchange/Session.hs
+++ b/src/Network/BitTorrent/Exchange/Session.hs
@@ -18,6 +18,7 @@ module Network.BitTorrent.Exchange.Session
18 18
19 -- * Events 19 -- * Events
20 , waitMetadata 20 , waitMetadata
21 , takeMetadata
21 ) where 22 ) where
22 23
23import Control.Applicative 24import Control.Applicative
@@ -355,6 +356,9 @@ sendBroadcast msg = do
355waitMetadata :: Session -> IO InfoDict 356waitMetadata :: Session -> IO InfoDict
356waitMetadata Session {..} = cachedValue <$> readMVar infodict 357waitMetadata Session {..} = cachedValue <$> readMVar infodict
357 358
359takeMetadata :: Session -> IO (Maybe InfoDict)
360takeMetadata Session {..} = fmap cachedValue <$> tryReadMVar infodict
361
358{----------------------------------------------------------------------- 362{-----------------------------------------------------------------------
359-- Triggers 363-- Triggers
360-----------------------------------------------------------------------} 364-----------------------------------------------------------------------}