1Haskell Distributed Project
2===========================
4This repository holds an implementation of [Cloud Haskell][1] based on the work
5of Jeff Epstein, Andrew Black, and Simon Peyton-Jones.
7At present, this repository hosts two packages:
12For more detailed information about the interfaces provided by these packages,
13please refer to the [distributed-process repository wiki][2].
18Examples of the transport layer at work can be found in the `/examples` folder.
22The `DemoTransport.hs` file contains a number of different functions named
23`demo#`. These functions demonstrate the use of the `Network.Transport` module.
25To try them out, launch `ghci`, including the appropriate sources:
27 ghci -idistributed-process/src -inetwork-transport/src examples/DemoTransport.hs
29The first demo, `demo0` yields the following output when run with the TCP transport:
31 *DemoTransport> tcp >>= demo0
32 logServer: [Chunk "hello 1" Empty]
33 logServer: [Chunk "hello 2" Empty]
34 logServer: [Chunk "hello 3" Empty]
35 logServer: [Chunk "hello 4" Empty]
36 logServer: [Chunk "hello 5" Empty]
37 logServer: [Chunk "hello 6" Empty]
38 logServer: [Chunk "hello 7" Empty]
39 logServer: [Chunk "hello 8" Empty]
40 logServer: [Chunk "hello 9" Empty]
41 logServer: [Chunk "hello 10" Empty]
43See the source code for more details.
47The `DemoProcess.hs` file shows a very basic example of how to use the
48`Control.Distributed.Process` module in conjunction with `Network.Transport.TCP`.
49This is demonstrated using the `demo1` function:
51 ghci -idistributed-process/src -inetwork-transport/src examples/DemoProcess.hs
53The output of the example is as follows:
58 1: jim1 says: hi there
59 2: bob1 says: hi there
65The `DemoTCP.hs` file demonstrates how a master can be connected to slaves
66using the transport layer over TCP.
67This example should be compiled in the usual fashion:
69 ghc --make -idistributed-process/src -inetwork-transport/src examples/DemoTCP.hs
71After compiling, the following will initialize a new master that waits
72for two clients to connect on the local machine:
74 ./examples/DemoTCP 127.0.0.1 8080 sourceAddrFile 2
76Following this, two slaves should be created that will connect to the master:
78 ./examples/DemoTCP 127.0.0.1 8081 sourceAddrFile
79 ./examples/DemoTCP 127.0.0.1 8082 sourceAddrFile
81Once the connection is established, the slaves will provide the master
82with their `SourceAddr`. The master then decodes this, and sends a message
83back. After processing this message, the slaves respond to the master,
84which then outputs some data.
89The `Transport.TCP` backend uses `Network.ByteString.Lazy` as its underlying
90protocol, so we produce a benchmark that compares it directly with this.
91Furthermore, the `Data.Binary` package is used for converting values
92to `ByteStrings` for transmission.
94The benchmarking is performed on the client side using criterion:
95the server must be set up before benching is performed.
99This benchmark measures how quickly a sequence of ping/pong messages
100are sent between a server and client. Full details can be found in:
102 ./benchmarks/PingTCP.hs
103 ./benchmarks/PingTransport.hs
107This benchmark measures how quickly a number of bytes can be sent from
108a client to a server. Full details can be found in the following files:
110 ./benchmarks/SendTCP.hs
111 ./benchmarks/SendTransport.hs
113[1]: http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/remote.pdf
114[2]: https://github.com/haskell-distributed/distributed-process/wiki
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