diff options
author | joe <joe@jerkface.net> | 2017-07-28 05:12:03 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-07-28 05:12:03 -0400 |
commit | 40d376e7a41267fd4e96eb95a5ad728429deeed5 (patch) | |
tree | 17dc815ec1ebd10cf94081cd8b07b984b2cbce4b /examples | |
parent | 7f7ede57388ed29e0fbaab9aac6b9211f67ee3e2 (diff) |
Removed async-pool as dependency for dhtd executable.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dhtd.hs | 7 |
1 files changed, 4 insertions, 3 deletions
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 | |||
53 | import Data.Aeson as J (ToJSON, FromJSON) | 53 | import Data.Aeson as J (ToJSON, FromJSON) |
54 | import qualified Data.Aeson as J | 54 | import qualified Data.Aeson as J |
55 | import qualified Data.ByteString.Lazy as L | 55 | import qualified Data.ByteString.Lazy as L |
56 | import Control.Concurrent.Async.Pool | 56 | import Tasks |
57 | import System.IO.Error | 57 | import System.IO.Error |
58 | import qualified Data.Serialize as S | 58 | import qualified Data.Serialize as S |
59 | import Network.BitTorrent.DHT.ContactInfo as Peers | 59 | import Network.BitTorrent.DHT.ContactInfo as Peers |
@@ -139,8 +139,9 @@ pingNodes netname DHT{dhtPing} = do | |||
139 | Right ns -> do fork $ do | 139 | Right ns -> do fork $ do |
140 | myThreadId >>= flip labelThread ("pinging."++fname) | 140 | myThreadId >>= flip labelThread ("pinging."++fname) |
141 | putStrLn $ "Forked "++show fname | 141 | putStrLn $ "Forked "++show fname |
142 | withTaskGroup 10 $ \g -> do | 142 | withTaskGroup ("withTaskGroup."++fname) 10 $ \g -> do |
143 | mapTasks_ g (map dhtPing ns) | 143 | mapM_ (\n -> forkTask g (show n) $ void $ dhtPing n) |
144 | (ns `asTypeOf` []) | ||
144 | putStrLn $ "Load finished "++show fname | 145 | putStrLn $ "Load finished "++show fname |
145 | return True | 146 | return True |
146 | 147 | ||