package
Simple Storm-like distributed application, Work in Progress
npm install simplestormGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Latest published Mar 4, 2014
Simple Storm-like distributed application, implementation, for Node.js. See
Via npm on Node:
npm install simplestormReference in your program:
var simplestorm = require('simplestorm');You have Spouts (message sources) and Bolts (message processor). An Spout should have a start function.
function Spout() {
this.start = function(context) {
// ...
context.emit(msg); // you can emit a message many times
// ....
}
}An spout emit message via its controller, in any of its methods.
A Bolt has a process method:
function MyBolt() {
this.process = function(msg, context) {
// Message process
// and emit new message(s)
context.emit(newmsg);
}
}There is a topology builder:
// Objects
var spout = new Spout();
var downloader = new Downloader();
var resolver = new Resolver();
var harvester = new Harvester();
// Setting Builder
var builder = ss.createTopologyBuilder();
builder.setSpout("spout", spout);
builder.setBolt("downloader", downloader).shuffleGrouping("resolver").shuffleGrouping("spout");
builder.setBolt("resolver", resolver).shuffleGrouping
Start a topology:
topology.start();Stop a topology (WIP):
topology.stop();A topology worker can listen external messages, sent from other topology workers:
topology.listen(port);If they are many topology workers, they can share its address using a central server. In a process, create a topology server:
var tserver = ss.createTopologyServer();
tserver.listen(port);In each topology worker, connect to the topology server:
topology.connectToServer(port, host);When a topology worker connects to the central server, it sends its address. The server shares that address with the rest of the topology workers. See Distributed Web Crawler with Server/Workers for a running example.
git clone git://github.com/ajlopez/SimpleStorm.git
cd SimpleStorm
npm install
npm testFeel free to file issues and submit pull requests � contributions are welcome.
If you submit a pull request, please be sure to add or update corresponding
test cases, and ensure that npm test continues to pass.
(Thanks to JSON5 by aseemk. This file is based on that project README.md).
Estimated unpacked size across 3 packages.
28.5 kB
Includes dependencies.