From 40d376e7a41267fd4e96eb95a5ad728429deeed5 Mon Sep 17 00:00:00 2001 From: joe Date: Fri, 28 Jul 2017 05:12:03 -0400 Subject: Removed async-pool as dependency for dhtd executable. --- bittorrent.cabal | 1 - examples/dhtd.hs | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bittorrent.cabal b/bittorrent.cabal index 5f5af8c7..a22f6550 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal @@ -334,7 +334,6 @@ executable dhtd default-language: Haskell2010 build-depends: base, network, bytestring, hashable, deepseq , aeson - , async-pool , pretty , bittorrent , unix diff --git a/examples/dhtd.hs b/examples/dhtd.hs index b63bd6fc..9bb7c5a7 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs @@ -53,7 +53,7 @@ import Network.DHT.Routing as R import Data.Aeson as J (ToJSON, FromJSON) import qualified Data.Aeson as J import qualified Data.ByteString.Lazy as L -import Control.Concurrent.Async.Pool +import Tasks import System.IO.Error import qualified Data.Serialize as S import Network.BitTorrent.DHT.ContactInfo as Peers @@ -139,8 +139,9 @@ pingNodes netname DHT{dhtPing} = do Right ns -> do fork $ do myThreadId >>= flip labelThread ("pinging."++fname) putStrLn $ "Forked "++show fname - withTaskGroup 10 $ \g -> do - mapTasks_ g (map dhtPing ns) + withTaskGroup ("withTaskGroup."++fname) 10 $ \g -> do + mapM_ (\n -> forkTask g (show n) $ void $ dhtPing n) + (ns `asTypeOf` []) putStrLn $ "Load finished "++show fname return True -- cgit v1.2.3