Same idea as https://gist.github.com/2500291, with node.js. Do
$ node forkpeer.js
It'll print out its pid. Then
$ curl http://localhost:8000/
To reload it, use
Same idea as https://gist.github.com/2500291, with node.js. Do
$ node forkpeer.js
It'll print out its pid. Then
$ curl http://localhost:8000/
To reload it, use
| var msg = require('./messages'), net = require('net'); | |
| s1 = new msg.MessageStream(net.createConnection(9000)); | |
| s1.send('pub'); | |
| s2 = new msg.MessageStream(net.createConnection(9000)); | |
| s2.send('sub'); | |
| s2.on('message', function(m) { console.log(m.toString()); }); | |
| s1.send('Hello world!'); |