|Peter J. Jones 9f53b212d5 Ignore cabal sandbox||6 years ago|
|src||6 years ago|
|www||6 years ago|
|.gitignore||6 years ago|
|LICENSE||6 years ago|
|README.md||6 years ago|
|Setup.hs||6 years ago|
|distinfo.cabal||6 years ago|
|distinfo.hs||6 years ago|
A peer-based distributed application written in Haskell with an embedded web server.
This example application is different than a traditional distributed-process application because it doesn’t use a master/slave configuration. Instead, all peers are equal and notify one another of their existence.
Not many. It’s intentionally very minimal.
After starting, the application will discover peers on the local network and request from each a reply containing basic information (hostname, OS, etc.).
When a node receives a request for information it records the existence of the requesting peer in a mutable map. It also begins monitoring the peer for failure.
If a node dies or terminates peers will remove the deceased node from their node maps.
Nodes that were started with the
-w flag include a web server on
port 8000 (use
-W to use another port.) Browsing to that port
on localhost will show an automatically updating list of peers.
When running nodes on different machines you must use the
flag to set your public IP address so other peers can see you. It
would be nice if this was automatically set.
On the other hand, when running more than one node on the same
machine you need to use the
-n flag to specify a port number so
that each node has a unique port.
I’ve stripped out all use of Template Haskell from this application, including the remotable table. Therefore you can’t spawn processes on remote nodes.