Partition.IO is a P2P Distributed workload for NodeJS. Partition.IO allows you to create a homogeneous system that is shared-nothing and partition tolerant.
To install just use npm
$ npm install partition.io
The api has 3 main components. The Servent, the Worker, and the Job.
The servent acts as the communication layer for the P2P system, the worker is a template that defines work to be done. The job is a representation of work being done by a worker.
Getting going with a distributed system using Partition.IO is easy.
var Servent = Serventservent =port = 8888;servent;/*** First bind to our default port, if we can't then use* an ephemeral port instead*/servent;servent;
Creating a worker is also easy, just call
be sure to set the last parameter taken as callback, this is how data gets
back to Partition.IO.
/*** Create our worker* params will be passed in directly from your function definition* callback set as the last param*/var worker = servent;/*** This will run the worker (as a job)*/worker;
Before I add more features, first I need to write some tests.
If you would like to contribute, just drop me a line or a pull request.
(The MIT License)
Copyright (c) 2011 Russell Bradberry <email@example.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.