Node.js tutorials

The following tutorials walk through setting up DCP jobs to run in a Node.js environment. This is quick and useful when a web interface isn’t needed.

Tutorial descriptions

toUpperCase on DCP

This is the simplest tutorial. It splits a string into its individual characters, and workers capitalize those characters in parallel. You wouldn’t distribute this, but it demonstrates DCP code.

Distributed Sorting

A longer tutorial with involved input/result processing. It splits a list of integers into chunks, and has workers sort the chunks in parallel. Once the chunks have returned, the program merges them into one sorted list. Since the chunks are already sorted, they merge with a greedy algorithm.

Parallel Mandelbrot GIF Making

This is the longest and coolest. The mandelbrot set is a fractal (a never ending pattern) with stunning patterns when zoomed in on. The geometry takes calculation, and zooming in requires re-calculating. This app sends individual frames to workers and puts them into one GIF.

Environment

You need:

Examples

For more examples on interacting with DCP through Node.js, see the examples folder from the dcp-client package on npm.