1module DemoProcess where
3import Control.Distributed.Process
4import Control.Concurrent (threadDelay)
6import Network.Transport.MVar (mkTransport)
10 node <- newLocalNode trans
14 lpid1 <- spawnLocal (logger 1)
15-- liftIO $ print "baz"
16-- lpid2 <- spawnLocal (logger 2)
18 spawnLocal (chatty "jim1" lpid1)
19-- spawnLocal (chatty "jim2" lpid2)
20 spawnLocal (chatty "bob1" lpid1)
21-- spawnLocal (chatty "bob2" lpid2)
22 liftIO $ threadDelay 500000
25chatty :: String -> ProcessId -> Process ()
26chatty name target = do
27 send target (name ++ " says: hi there")
28 liftIO $ threadDelay 500000
29 send target (name ++ " says: bye")
31logger :: Int -> Process ()
34 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