{"_id":"@defiantcaptain/spork-js","_rev":"2-b3cb3ea86450d4b25407ec0fa6465885","name":"@defiantcaptain/spork-js","description":"This program is designed to work in tandum with the EXEC to provide a library to support a multi-tasking system. This does nothing meaningful outside of context","dist-tags":{"latest":"1.1.4"},"versions":{"1.1.4":{"name":"@defiantcaptain/spork-js","version":"1.1.4","description":"This program is designed to work in tandum with the EXEC to provide a library to support a multi-tasking system. This does nothing meaningful outside of context","main":"index.js","scripts":{},"author":{"name":"Charles Smartt"},"license":"MIT","dependencies":{"@defiantcaptain/spork-js-events":"1.4.2","@types/node":"^8.0.24","uuid":"^3.1.0"},"_id":"@defiantcaptain/spork-js@1.1.4","_shasum":"fbdfa2d59334fa966ae1d47a4f81838729c5083e","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"defiantcaptain","email":"smarttcc@gmail.com"},"dist":{"shasum":"fbdfa2d59334fa966ae1d47a4f81838729c5083e","tarball":"https://registry.npmjs.org/@defiantcaptain/spork-js/-/spork-js-1.1.4.tgz","integrity":"sha512-GuiuLlQdpxA8BBxWI4gG3y/eXr9lTLhMBZ8jjmW6LX/Dcl6MvOxuBdnpUXPLMNwrcSpL5VdTkkxhzs+Cdjy4UA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgYxDiVUxtU14EmCOj9xYOkalse3BEUJXaHb9LXn74CAIgBDJ3B5ht42Ae2LlubuPuueRjf6hV20W4RXfTDbq5iqc="}]},"maintainers":[{"name":"defiantcaptain","email":"smarttcc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spork-js-1.1.4.tgz_1507688577095_0.9736770689487457"}}},"readme":"#Spork-JS\n\nNot designed for external conusmption as its usage won't make much sense.\n\n```javascript\n Spork.$('main.js').fork(1, (it) => {\n     return [\"bob\"];\n }).join((results) => {\n     process.send({event: 'done', results: results});\n }).error((err) => {\n     console.log(err);\n }).start();\n\n```\n\n`$('main.js')` is the script to be executed, with `Spork Spork::fork(n, callback)` representing\nthe number of `main.js` arguments to execute, and the callback designed to provide `string[]` as\narguments to the program. `join` is called when all forked processes are completed, and the\n`error` is designed to provide details about the failure. `start` finalizes the process and beings the forking\nprocess formally.\n\n`start` must always be invoked last, but `fork`, `join` and `error` can be added to the `Spork` in any order.\n\n## Objects and Whatnot\n\n### IDisposable\nInterface to prevent objects from being reused. A `Spork` is intended to be used once only.\n\n### Spork implements IDisposable\nClass that implements the forking logic.\n\n* `static $(script : string)` takes a string that is the script to be executed.\n* `get eventID() : string` is a uuidv1 of the Spork for mapping purposes.\n* `isDisposed() : boolean` is true if the object has been disposed. The object disposes itself.\n* `join ((...) => void)` is invoked when all forks are done.\n* `error((...) =>  void)` is invoked if there is a detected and expected error.\n* `fork(n:number, (iteration) => string[])` is the forking operation that takes a number of iterations `n` and a\ncloser that is invoked on each iteration to great a list of `strings` that serve as arguments.\n* `start()` to begin the forking process.\n* `result(instanceID : string, value : any)` is a callback to be invoked when a particular forked event has a result;\neach forked process as an `instanceID` for the fork.\n\nAll public facing functions, if invoked on a disposed object, will throw an error string `this is dead`. This object is not\ndesigned for reuse.\n\n###Events\n`SporkEvents.JOIN` dispatched when all forks are done.\n`SporkEvents.ERROR` dispatched when an error happens.\n`SporkProcessEvents.FORK_ME` dispatched when we ask the governing application for forks.\n`SporkProcessEvents.DONE` is dispatched when a spawned process is complete.\n\n###SporkHandler Namespace\nContains a mapping object `SporkMap` that is a hash of outlying events. This is global, and each\nindividual `Spork` deals with specific instances.\n\n","maintainers":[{"name":"defiantcaptain","email":"smarttcc@gmail.com"}],"time":{"modified":"2022-06-12T16:59:51.662Z","created":"2017-10-11T02:22:58.071Z","1.1.4":"2017-10-11T02:22:58.071Z"},"author":{"name":"Charles Smartt"},"license":"MIT","readmeFilename":"readme.md"}