1module DemoProcess where
3import Control.Distributed.Process
4import Control.Concurrent (threadDelay)
6import Network.Transport.TCP (mkTransport, TCPConfig (..))
11 trans <- mkTransport $ TCPConfig undefined "127.0.0.1" "8080"
12 node <- newLocalNode trans
15 liftIO $ print "Starting process"
16 lpid1 <- spawnLocal (logger 1)
17 spawnLocal (chatty "jim1" lpid1)
18 spawnLocal (chatty "bob1" lpid1)
19 liftIO $ threadDelay 500000
22chatty :: String -> ProcessId -> Process ()
23chatty name target = do
24 send target (name ++ " says: hi there")
25 liftIO $ threadDelay 500000
26 send target (name ++ " says: bye")
28logger :: Int -> Process ()
31 liftIO . putStrLn $ show n ++ ": " ++ str
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