1-- | Like Throughput, but send every ping from a different process
2-- (i.e., require a lightweight connection per ping)
3import System.Environment
5import Control.Applicative
6import Control.Distributed.Process
7import Control.Distributed.Process.Node
8import Network.Transport.TCP (createTransport, defaultTCPParameters)
9import Data.Binary (encode, decode)
10import qualified Data.ByteString.Lazy as BSL
15 go :: Int -> Process ()
20 Just them -> send them n >> go 0
22count :: Int -> ProcessId -> Process ()
25 replicateM_ n . spawnLocal $ send them (Nothing :: Maybe ProcessId)
28 liftIO $ print (n == n')
30initialProcess :: String -> Process ()
31initialProcess "SERVER" = do
33 liftIO $ BSL.writeFile "counter.pid" (encode us)
35initialProcess "CLIENT" = do
37 them <- liftIO $ decode <$> BSL.readFile "counter.pid"
42 [role, host, port] <- getArgs
43 Right transport <- createTransport host port defaultTCPParameters
44 node <- newLocalNode transport initRemoteTable
45 runProcess node $ initialProcess role
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list