From 6e9b81c9009140db4807bd51baadcf3be785ee15 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Wed, 19 Feb 2014 05:51:39 +0400 Subject: Add MonadActive instance for DHT --- src/Network/BitTorrent/DHT/Session.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Network/BitTorrent/DHT/Session.hs') diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs index 75d3294f..a452b764 100644 --- a/src/Network/BitTorrent/DHT/Session.hs +++ b/src/Network/BitTorrent/DHT/Session.hs @@ -264,6 +264,12 @@ instance MonadBaseControl IO (DHT ip) where restoreM = DHT . restoreM . unSt {-# INLINE restoreM #-} +-- | Check is it is possible to run 'queryNode' or handle pending +-- query from remote node. +instance MonadActive (DHT ip) where + monadActive = getManager >>= liftIO . isActive + {-# INLINE monadActive #-} + -- | All allocated resources will be closed at 'stopNode'. instance MonadResource (DHT ip) where liftResourceT m = do -- cgit v1.2.3