{"_id":"threads_a_gogo","_rev":"45-8e027766efc2791ccdb1af6e7340947e","name":"threads_a_gogo","description":"██ Simple and fast JavaScript threads for Node.js ██","dist-tags":{"latest":"0.1.13"},"versions":{"0.1.0":{"name":"threads_a_gogo","version":"0.1.0","main":"build/release/threads_a_gogo.node","description":"██████ Simple and fast JavaScript threads for Node.js ██████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"email":"jorge@jorgechamorro.com","url":"http://github.com/xk/node-threads-a-gogo/issues"},"license":"MIT","repository":{"type":"git","url":"git://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-waf configure install"},"os":["macos","linux"],"engines":{"node":">=0.5.1"},"_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"_id":"threads_a_gogo@0.1.0","contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"}],"dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"c15bad830ce86711e5931bb729c7be62a81637a9","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.0.tgz","integrity":"sha512-zaycXby//namm+ps3HI4ZS3A/HYsSN7dHms6hp5Z+d4WQCGoyWEupZQRbl1cDRpPUpeKjcdW2CGck5Y5ThIKWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHQmaGo3tXoC3SdLE7sTu89UrdbkMj5aANFcylhhJRRQIgYgE6xrKFRYJftEmV2C/9YNrktu9HCBNo9wVYjlxnwds="}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"directories":{}},"0.1.1":{"name":"threads_a_gogo","version":"0.1.1","main":"build/release/threads_a_gogo.node","description":"██████ Simple and fast JavaScript threads for Node.js ██████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"email":"jorge@jorgechamorro.com","url":"http://github.com/xk/node-threads-a-gogo/issues"},"license":"MIT","repository":{"type":"git","url":"git://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-waf configure install"},"os":["macos","linux"],"engines":{"node":">=0.5.1"},"_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"_id":"threads_a_gogo@0.1.1","contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"}],"dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"fdaf62d903a4c7128cc5c7684e7f0dff56eaf14a","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.1.tgz","integrity":"sha512-dQhWnKo4qlIrktXeinoHJBi1ypRucrdjycydKFURGW4qZ3DOWqQnkNO0rBOgxLQ7KPeUop3GkNTLwF+81GNCDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHe9hYsc9QQZeo/vj2EFnXLiJwYeJT+oN9Yly+i+J4qgIhALI4RsIID1g8UanwOQPCFAU944z3WWeV5+T/wNcgy77m"}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"directories":{}},"0.1.2":{"name":"threads_a_gogo","version":"0.1.2","main":"build/release/threads_a_gogo.node","description":"██████ Simple and fast JavaScript threads for Node.js ██████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"email":"jorge@jorgechamorro.com","url":"http://github.com/xk/node-threads-a-gogo/issues"},"license":"MIT","repository":{"type":"git","url":"git://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-waf configure install"},"os":["macos","linux"],"engines":{"node":">=0.5.1"},"_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"_id":"threads_a_gogo@0.1.2","contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"}],"dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"86d82950451ae2945a29f28aa4b966c2f296fc6a","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.2.tgz","integrity":"sha512-DJqfNMgOcvZMQBOrMJb/+PNEajJfHVuGJ2WLopHRBbLq0Be4gosQrLs6ZnIFkV2C4vDxZ9o2q6tUPCg7OFg1fg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFatg03kXRqgWSt7KC+asIG8988ZB5RUyhoHRtrO2YIAIhAKi221gRoW3NgLYqcIeYDcYxEO1S/tnPfJtQD4ByiKcN"}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"directories":{}},"0.1.3":{"name":"threads_a_gogo","version":"0.1.3","main":"build/release/threads_a_gogo.node","description":"██████ Simple and fast JavaScript threads for Node.js ██████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"email":"jorge@jorgechamorro.com","url":"http://github.com/xk/node-threads-a-gogo/issues"},"license":"MIT","repository":{"type":"git","url":"git://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-waf configure install"},"os":["macos","linux"],"engines":{"node":">=0.5.1"},"_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"_id":"threads_a_gogo@0.1.3","contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"}],"dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"eabb626e90ed4af4f9a50bc3085c09a2e45ad3a8","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.3.tgz","integrity":"sha512-pjfQG4YPLaIj4RBgBpXs0Y/zD21EYHLX9ZIyrzU/zBbjBycrBxKBWYV8Nkf+0fWFyu4rCeWvQYD8yC9Mw4G8OA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHxd6OiPwaS88TXqUYiasoFsFe0wDFRFTRPJsWoxAs5tAiEAtQQB4GbeHbPEBITrHBedKF3sTPMIptY/NOP6SI0ADDU="}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"directories":{}},"0.1.4":{"name":"threads_a_gogo","version":"0.1.4","main":"build/release/threads_a_gogo.node","description":"██████ Simple and fast JavaScript threads for Node.js ██████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"email":"jorge@jorgechamorro.com","url":"http://github.com/xk/node-threads-a-gogo/issues"},"license":"MIT","repository":{"type":"git","url":"git://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-waf configure install"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1"},"_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"_id":"threads_a_gogo@0.1.4","contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"}],"dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"e6cedf13e94e1c1563a2702601d4ca0effbb1f75","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.4.tgz","integrity":"sha512-1hp6vBRdnugF4O/sf05bMqA0NelDHEqZa7bU2zZ3OX+YviTOOeVE7MczmUY2mSZY7Cr9jHizaqvXScDwQtA/TA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv4OMfFNwvoWYGCposZpXejRdcO/Y4DiXrNkby2/dGhAIhAOaBGesIc02WNsmFePXPRYDO6Gv66aftaSfj3uTKsf3V"}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}]},"0.1.5":{"name":"threads_a_gogo","version":"0.1.5","main":"build/release/threads_a_gogo.node","description":"████ Simple and fast JavaScript threads for Node.js ████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-waf configure install"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1"},"contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"}],"_id":"threads_a_gogo@0.1.5","dist":{"shasum":"0b44191efbbecd14c2d7eda5a56e997ac25b19b2","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.5.tgz","integrity":"sha512-tZi48P3U0k2XR5gaFC7azGMwG3z1sRbALLOj0ANBZ5qkxoKxrvHgv54L6xHDNRKHFLPPhqOBqHE8pDavvZEJsw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsy2gzVyVCq8mXPclvpeCNFJZraXdEIYFQu7w4zGM8xAIgE9LKgyHEBJPJMWZ4Cq24LJ7XBH6/fvli/k+i0fW8M5Q="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}]},"0.1.6":{"name":"threads_a_gogo","version":"0.1.6","main":"build/release/threads_a_gogo.node","description":"████ Simple and fast JavaScript threads for Node.js ████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp rebuild"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1"},"dependencies":{"bindings":"*"},"contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"}],"gypfile":true,"_id":"threads_a_gogo@0.1.6","dist":{"shasum":"665d8c75e97763cf049821ce81f7d4e56ff9b7e5","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.6.tgz","integrity":"sha512-561PEPRIeVSY8kI1gTCDOyRUXKp2b2KN5llWQwOvBQQlAKFIrNMulOlgp5PbetAnJq2mzVlgmd1ieGJmC9i4Jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeEd9yfIZ+txrBtLhfMcUFF3CpOmt/eAO2NVZGMwDQdgIgV+dbAKo3cNGewaEQ8pgihdRz34TwbAN2gdxzB3WMbEg="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}]},"0.1.7":{"name":"threads_a_gogo","version":"0.1.7","main":"build/release/threads_a_gogo.node","description":"████ Simple and fast JavaScript threads for Node.js ████","keywords":["The","most","awesome","project","ever","a gogo"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp rebuild"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1"},"dependencies":{"bindings":"*"},"contributors":[{"name":"//Threads_a_gogo AUTHORS"},{"name":"2011-11-06 Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"2011-11-25 Juan Falgueras Cano","email":"juan.falgueras@gmail.com"},{"name":"2012-01-26 Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"2014-02-27 IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"gypfile":true,"_id":"threads_a_gogo@0.1.7","dist":{"shasum":"6deea311970e6e2df2296fb613c9a0d4e5f2dad7","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.7.tgz","integrity":"sha512-pdRDAWYlv/z+XGcKUpj4/pN3Sh8SdD8BRqf1GPsAffCAPwUSKx67k/mg3lOkPGPe2N0ipCd9EUJ+/LLQ9MAYbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHSVs88a5893eTbyYeNDq0EG4eYe9ngpJQHAV19NAFmrAiAT1/pwcz92H0/2CQN+A+4Q0FTe7/7VbdKI+opGWjl0ow=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}]},"0.1.8":{"name":"threads_a_gogo","version":"0.1.8","main":"build/Release/threads_a_gogo.node","description":"████ Simple and fast JavaScript threads for Node.js ████","keywords":["a gogo","ever","project","awesome","most","The"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp rebuild","test":"node test/all.js"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1 <0.11"},"devDependencies":{"test":">=0.1.8"},"contributors":[{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"gitHead":"05113000e711c156d8601c034cac2c108018b5ad","gypfile":true,"_id":"threads_a_gogo@0.1.8","_shasum":"74eef22055c95a53d01a540aba7d99e75f58fb77","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"dist":{"shasum":"74eef22055c95a53d01a540aba7d99e75f58fb77","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.8.tgz","integrity":"sha512-kTHn4IdEUFMPukhyEKX5zFmkwcg1jDLurrIz8Voe/uUfBnl/aO2uDuYU6On/Ph5iTanyZDZBkMkhOAClShJISg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBdPKd/CTNl+WYIlE4L7ClT2yR0KTHwuQW9pxUjqlfaAAiB537cO8jh1Ynnm8xUatX8E/qh6ciIOJnYhIHSsJefHKw=="}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/threads_a_gogo-0.1.8.tgz_1482419994603_0.8329884423874319"}},"0.1.9":{"name":"threads_a_gogo","version":"0.1.9","main":"build/Release/threads_a_gogo.node","description":"███ Simple and fast JavaScript threads for Node.js ███","keywords":["a gogo","ever","project","awesome","most","The"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp rebuild","test":"node test/all.js"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1 <0.11"},"devDependencies":{"test":">=0.1.8"},"contributors":[{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"gitHead":"8d5b3623e5b33b8cb38d10298db5ca4df11d3db8","gypfile":true,"_id":"threads_a_gogo@0.1.9","_shasum":"3186d04361c0cf1702259a80fc5163809b4b5730","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"dist":{"shasum":"3186d04361c0cf1702259a80fc5163809b4b5730","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.9.tgz","integrity":"sha512-7C8uv9DL0KuoGppDtHJzIDCJxcNt0n0KZl9cQzEia6Jt6fPxxEUOi6LDMRV5vvR9rL3E8DJ8WXHdlBFuwBHSXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD43Rg7EL2YLSyXGDvpkLSVKAVs5u98WbBL5G9JxjRF0AIgVTBTyVDbJCIZnYZW9hXQMqyCaMJnFZs5lTvCLUlDvtM="}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/threads_a_gogo-0.1.9.tgz_1482422333626_0.40488226525485516"}},"0.1.10":{"name":"threads_a_gogo","version":"0.1.10","main":"build/Release/threads_a_gogo.node","description":"███ Simple and fast JavaScript threads for Node.js ███","keywords":["a gogo","ever","project","awesome","most","The"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp rebuild","test":"node test/all.js"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1 <0.11"},"devDependencies":{"test":">=0.1.8"},"contributors":[{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"gitHead":"d5f38573ab1049e59d2aaab60458889e705a9c27","gypfile":true,"_id":"threads_a_gogo@0.1.10","_shasum":"9eebfa3641b183529dff21c50491fba41227e596","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"dist":{"shasum":"9eebfa3641b183529dff21c50491fba41227e596","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.10.tgz","integrity":"sha512-LNsq+hLsI4ykYwMDFby/lZLKXD1oIVhqcbO5ltHqY3xKnbDPL0K8p0uR6zMjd6ue/fjk6WKqF0+FwgQ0WYhn2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCs42TEqT3VDCuGuN/LnHYFBQlgLfyR0KExldSV4mtNrQIhAMzp0m3y41WoSiE44E34JyZZL++hXOZNT4IT+SRo/oXo"}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/threads_a_gogo-0.1.10.tgz_1482513870110_0.6476594039704651"}},"0.1.11":{"name":"threads_a_gogo","version":"0.1.11","main":"build/Release/threads_a_gogo.node","description":"███ Simple and fast JavaScript threads for Node.js ███","keywords":["a gogo","ever","project","awesome","most","The"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp rebuild","test":"node test/all.js"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1 <0.11"},"devDependencies":{"test":">=0.1.8"},"contributors":[{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"gitHead":"4ddbafe3a5798e75297d47346298e11798215e57","gypfile":true,"_id":"threads_a_gogo@0.1.11","_shasum":"6a650f1f739107a37a7076120589e1075a151ce1","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"dist":{"shasum":"6a650f1f739107a37a7076120589e1075a151ce1","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.11.tgz","integrity":"sha512-Q/IxIpL1R823ilOkvkUgHLcNZWI2RvkzE92bi2vYk2Loquvq2DkQOzudNsJONgyiJNzAE69H4xRYu8Al2TZEzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPmHyIgQe+g4d2zWvbeikAHfEyOzI6BETZ4YzbIuiwFQIgRdqpp8ROXGkpbujdpGUQ5Cxd7zO0L9tGb9IgarhC7PI="}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/threads_a_gogo-0.1.11.tgz_1482526957708_0.357265189755708"}},"0.1.12":{"name":"threads_a_gogo","version":"0.1.12","main":"build/Release/threads_a_gogo.node","description":"██ Simple and fast JavaScript threads for Node.js ██","keywords":["a gogo","ever","project","awesome","most","The"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"http://github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp -v rebuild","test":"node test/all.js"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1 <0.11"},"devDependencies":{"test":">=0.1.8"},"contributors":[{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"gitHead":"f0f3d64d0ccfd7db367622c1fec5448acc344787","_id":"threads_a_gogo@0.1.12","_shasum":"e688a3312fd3989857a821744fa43a6656f31549","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"dist":{"shasum":"e688a3312fd3989857a821744fa43a6656f31549","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.12.tgz","integrity":"sha512-fn5y/YAmEy/b29v+r1vzMic/XOubHYz0Iou8dHSrvDLfZQFNfBYy0LdrgmvRX6D9aE/CXPERhpA+vEznXwU2tg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmrp4OEGSvsZVnd0FR25Pw16Gjrp9d/Euhb9w2ONPn+AiEAzZ3ylyZGszhePy7Qe4EEWvQ/Va9yf98IVxTJR6ALQww="}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/threads_a_gogo-0.1.12.tgz_1482567389877_0.8822120234835893"}},"0.1.13":{"name":"threads_a_gogo","version":"0.1.13","main":"build/Release/threads_a_gogo.node","description":"██ Simple and fast JavaScript threads for Node.js ██","keywords":["a gogo","ever","project","awesome","most","The"],"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"homepage":"https://github.com/xk/node-threads-a-gogo","bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/xk/node-threads-a-gogo.git"},"scripts":{"install":"node-gyp -v rebuild","test":"node test/all.js"},"os":["macos","linux","darwin"],"engines":{"node":">=0.5.1 <=6.9.2"},"devDependencies":{"test":">=0.1.8"},"contributors":[{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"gitHead":"5652632c33ba465989a0ee56b8ce0abb63af1041","_id":"threads_a_gogo@0.1.13","_shasum":"8c0006aa13443eec6ba55607d2e98d60764fc789","_from":".","_npmVersion":"2.15.11","_nodeVersion":"0.12.18","_npmUser":{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"},"dist":{"shasum":"8c0006aa13443eec6ba55607d2e98d60764fc789","tarball":"https://registry.npmjs.org/threads_a_gogo/-/threads_a_gogo-0.1.13.tgz","integrity":"sha512-gTjsd3KNwGhhzJKBOna+cryWjhIjzZ3svrEAEzSoZTlgG1Lyo95LB9eyc9scuM3B5g8YcvXgqJ6Rqsy8AUMjlA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFQfdnG+h16zWHkOE9dcrs+4Cf/9TNnVAbkHnfg9vAuyAiBFOrz5Yl3u7yk8W2pam8CUkzoC6oeocaU6Gjkz6pQjLg=="}]},"maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/threads_a_gogo-0.1.13.tgz_1483140881092_0.9187789789866656"}}},"readme":"[![build status](https://travis-ci.org/xk/node-threads-a-gogo.svg?branch=SYNC)](https://travis-ci.org/xk/node-threads-a-gogo)\n[![npm version](https://badge.fury.io/js/threads_a_gogo.svg)](https://www.npmjs.com/package/threads_a_gogo)\n\n***\n\n# TAGG: Threads à gogo for Node.js\n\nThreads à gogo ([*](http://en.wikipedia.org/wiki/%C3%80_gogo)) is a native module for Node.js that provides an asynchronous, evented and/or continuation passing style API for moving blocking/longish CPU-bound tasks out of Node's event loop to JavaScript threads that run in parallel in the background and that use all the available CPU cores automatically; all from within **a single Node** process.\n\n## Installing the module\n\nWith [npm](http://npmjs.org/):\n\n    npm install threads_a_gogo\n\nFrom source:\n\n    git clone http://github.com/xk/node-threads-a-gogo.git\n    cd node-threads-a-gogo\n    # One of\n    node-gyp rebuild\n    node test/all.js\n    # or\n    npm install\n    node test/all.js\n    # or\n    node-waf configure build install test\n    # Depending of what wersion of node you've got.\n    #\n    # THREADS_A_GOGO CURRENTLY (v0.1.13) RUNS ON NODES v0.5.1 TO v6.9.2\n\nBasic functionality test:\n\n    cd node-threads-a-gogo\n    node test/all.js\n    # If all goes well should ouput something like this:\n    0.OK.1.OK.2.OK.3.TAGG OBJECT OK\n    4.OK.5.OK.6.OK.7.OK.8.OK.9.OK.10.OK.11.OK.12.THREAD OBJECT OK\n    13.OK.WAITING FOR LOAD CB\n    14.OK.15.LOAD CALLBACK OK\n    16.OK.WAITING FOR EVAL CB\n    17.OK.18.OK.19.EVAL CALLBACK OK\n    20.OK.WAITING FOR EVENT LISTENER CB\n    21.OK.22.OK.23.OK.24.OK.25.OK.26.EVENT LISTENER CB.OK\n    27.OK.WAITING FOR DESTROY CB\n    28.OK.29.DESTROY CB OK\n    END\n    THREADS_A_GOGO v0.1.13 BASIC FUNCTIONALITY TEST: OK, IT WORKS!\n\nTo include the module in your project:\n\n    var tagg= require('threads_a_gogo');\n\n**You need a node with a v8 >= 3.2.4 to run this module. Any node >= 0.5.1 comes with a v8 >= 3.2.4.**\n\nThe module **runs fine, though, in any node >= 0.1.13** as long as you build it with a v8 >= 3.2.4, [see here](https://nodejs.org/en/download/releases/). To do that you simply have to replace /node/deps/v8 with a newer version of v8 and recompile it (node). To get any version of node goto http://nodejs.org/dist/, and for v8 goto http://github.com/v8/v8, click on \"branch\", select the proper tag (>= 3.2.4), and download the .zip.\n\n## Intro\n\nAfter the initialization phase of a Node program, whose purpose is to setup listeners and callbacks to be executed in response to events, the next phase, the proper execution of the program, is orchestrated by the event loop whose duty is to [juggle events, listeners and callbacks quickly and without any hiccups nor interruptions that would ruin its performance](https://youtu.be/D0uA_NOb0PE?autoplay=1)\n\nBoth the event loop and said listeners and callbacks run sequentially in a single thread of execution, Node's main thread. If any of them ever blocks, nothing else will happen for the duration of the block: no more events will be handled, no more callbacks nor listeners nor timeouts nor nextTick()ed functions will have the chance to run and do their job, because they won't be called by the blocked event loop, and the program will turn sluggish at best, or appear to be frozen and dead at worst.\n\n**A.-** Here's a program that makes Node's event loop spin freely and as fast as possible: it simply prints a dot to the console in each turn:\n\n    cat examples/quickIntro_loop.js\n    node examples/quickIntro_loop.js\n    \n``` javascript\n(function spinForever () {\n  process.stdout.write(\".\");\n  setImmediate(spinForever);\n})();\n```\n\n**B.-** Here's another program that adds to the one above a fibonacci(35) call in each turn, a CPU-bound task that takes quite a while to complete and that blocks the event loop making it spin slowly and clumsily. The point is simply to show that you can't put a job like that in the event loop because Node will stop performing properly when its event loop can't spin fast and freely due to a callback/listener/nextTick()ed function that's blocking.\n\n    cat examples/quickIntro_blocking.js\n    node examples/quickIntro_blocking.js\n\n``` javascript\nfunction fibo (n) {\n  return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;\n}\n\n(function fiboLoop () {\n  process.stdout.write(fibo(35).toString());\n  setImmediate(fiboLoop);\n})();\n\n(function spinForever () {\n  process.stdout.write(\".\");\n  setImmediate(spinForever);\n})();\n```\n\n**C.-** The program below uses `threads_a_gogo` to run the fibonacci(35) calls in a background thread, so Node's event loop isn't blocked at all and can spin freely again at full speed:\n\n    cat examples/quickIntro_oneThread.js\n    node examples/quickIntro_oneThread.js\n  \n``` javascript\nfunction fibo (n) {\n  return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;\n}\n\nfunction cb (err, data) {\n  process.stdout.write(data);\n  this.eval('fibo(35)', cb);\n}\n\nvar thread= require('threads_a_gogo').create();\n\nthread.eval(fibo).eval('fibo(35)', cb);\n\n(function spinForever () {\n  process.stdout.write(\".\");\n  setImmediate(spinForever);\n})();\n```\n\n**D.-** This example is almost identical to the one above, only that it creates 5 threads instead of one, each running a fibonacci(35) in parallel and in parallel too with Node's event loop that keeps spinning happily at full speed in its own thread:\n\n    cat examples/quickIntro_fiveThreads.js\n    node examples/quickIntro_fiveThreads.js\n  \n``` javascript\nfunction fibo (n) {\n  return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;\n}\n\nfunction cb (err, data) {\n  process.stdout.write(\" [\"+ this.id+ \"]\"+ data);\n  this.eval('fibo(35)', cb);\n}\n\nvar tagg= require('threads_a_gogo');\n\ntagg.create().eval(fibo).eval('fibo(35)', cb);\ntagg.create().eval(fibo).eval('fibo(35)', cb);\ntagg.create().eval(fibo).eval('fibo(35)', cb);\ntagg.create().eval(fibo).eval('fibo(35)', cb);\ntagg.create().eval(fibo).eval('fibo(35)', cb);\n\n(function spinForever () {\n  process.stdout.write(\".\");\n  setImmediate(spinForever);\n})();\n```\n\n**E.-** The next one asks `threads_a_gogo` to create a pool of 10 background threads, instead of creating them manually one by one:\n\n    cat examples/quickIntro_multiThread.js\n    node examples/quickIntro_multiThread.js\n\n``` javascript\nfunction fibo (n) {\n  return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;\n}\n\nvar numThreads= 10;\nvar threadPool= require('threads_a_gogo').createPool(numThreads).all.eval(fibo);\n\nthreadPool.all.eval('fibo(35)', function cb (err, data) {\n  process.stdout.write(\" [\"+ this.id+ \"]\"+ data);\n  this.eval('fibo(35)', cb);\n});\n\n(function spinForever () {\n  process.stdout.write(\".\");\n  setImmediate(spinForever);\n})();\n```\n\n**F.-** This is a demo of the `threads_a_gogo` eventEmitter API, using one thread:\n\n    cat examples/quickIntro_oneThreadEvented.js\n    node examples/quickIntro_oneThreadEvented.js\n\n``` javascript\nvar thread= require('threads_a_gogo').create();\nthread.load(__dirname + '/quickIntro_evented_childThreadCode.js');\n\n/*\n  This is the code that's .load()ed into the child/background thread:\n  \n  function fibo (n) {\n    return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;\n  }\n\n  thread.on('giveMeTheFibo', function onGiveMeTheFibo (data) {\n    this.emit('theFiboIs', fibo(+data)); //Emits 'theFiboIs' in the parent/main thread.\n  });\n  \n*/\n\n//Emit 'giveMeTheFibo' in the child/background thread.\nthread.emit('giveMeTheFibo', 35);\n\n//Listener for the 'theFiboIs' events emitted by the child/background thread.\nthread.on('theFiboIs', function cb (data) {\n  process.stdout.write(data);\n  this.emit('giveMeTheFibo', 35);\n});\n\n(function spinForever () {\n  process.stdout.write(\".\");\n  setImmediate(spinForever);\n})();\n```\n\n**G.-** This is a demo of the `threads_a_gogo` eventEmitter API, using a pool of threads:\n\n    cat examples/quickIntro_multiThreadEvented.js\n    node examples/quickIntro_multiThreadEvented.js\n\n``` javascript\nvar numThreads= 10;\nvar threadPool= require('threads_a_gogo').createPool(numThreads);\nthreadPool.load(__dirname + '/quickIntro_evented_childThreadCode.js');\n\n/*\n  This is the code that's .load()ed into the child/background threads:\n  \n  function fibo (n) {\n    return n > 1 ? fibo(n - 1) + fibo(n - 2) : 1;\n  }\n\n  thread.on('giveMeTheFibo', function onGiveMeTheFibo (data) {\n    this.emit('theFiboIs', fibo(+data)); //Emits 'theFiboIs' in the parent/main thread.\n  });\n  \n*/\n\n//Emit 'giveMeTheFibo' in all the child/background threads.\nthreadPool.all.emit('giveMeTheFibo', 35);\n\n//Listener for the 'theFiboIs' events emitted by the child/background threads.\nthreadPool.on('theFiboIs', function cb (data) {\n  process.stdout.write(\" [\"+ this.id+ \"]\"+ data);\n  this.emit('giveMeTheFibo', 35);\n});\n\n(function spinForever () {\n  process.stdout.write(\".\");\n  setImmediate(spinForever);\n})();\n```\n\n## More examples\n\nThe `examples` directory contains a few more examples:\n\n* [ex01_basic](https://github.com/xk/node-threads-a-gogo/blob/master/examples/ex01_basic.md): Running a simple function in a thread.\n* [ex02_events](https://github.com/xk/node-threads-a-gogo/blob/master/examples/ex02_events.md): Sending events from a worker thread.\n* [ex03_ping_pong](https://github.com/xk/node-threads-a-gogo/blob/master/examples/ex03_ping_pong.md): Sending events both ways between the main thread and a worker thread.\n* [ex04_main](https://github.com/xk/node-threads-a-gogo/blob/master/examples/ex04_main.md): Loading the worker code from a file.\n* [ex05_pool](https://github.com/xk/node-threads-a-gogo/blob/master/examples/ex05_pool.md): Using the thread pool.\n* [ex06_jason](https://github.com/xk/node-threads-a-gogo/blob/master/examples/ex06_jason.md): Passing complex objects to threads.\n\n## Module API\n\n## TAGG Object API\n``` javascript\ntagg= require('threads_a_gogo') -> tagg object\n\n{ create: [Function],\n  createPool: [Function: createPool],\n  version: '0.1.13' }\n  \n```\n### .create()\n`tagg.create( /* no arguments */ )` -> thread object\n\n### .createPool( numThreads )\n`tagg.createPool( numberOfThreads )` -> threadPool object\n\n### .version\n`tagg.version` -> A string with the threads_a_gogo version number.\n\n***\n\n## Thread Object API (this is the thread object you get in node's main thread)\n``` javascript\nthread= tagg.create() -> thread object\n\n{ load: [Function: load],\n  eval: [Function: eval],\n  emit: [Function: emit],\n  destroy: [Function: destroy],\n  id: 0,\n  version: '0.1.13',\n  on: [Function: on],\n  once: [Function: once],\n  _on: {},\n  removeAllListeners: [Function: removeAllListeners] }\n  \n```\n### .id\n`thread.id` -> A sequential thread serial number.\n\n### .version\n`thread.version` -> A string with the threads_a_gogo version number.\n\n### .load( path [, cb] )\n`thread.load( path [, cb] )` -> thread\n\nLoads the file at `path` and `thread.eval(fileContents, cb)`.\n\nNOTE that most methods return the `thread` object so that calls can be chained like this: `thread.load(\"boot.js\").eval(\"boot()\").emit(\"go\").on(\"event\", cb)` ...\n\n### .eval( program [, cb])\n`thread.eval( program [, cb])` -> thread\n\nConverts `program.toString()` and eval()s (which is the equivalent of loading a script in a browser) it in the thread's global context, and (if provided) returns to a callback the completion value: `cb(err, completionValue)`. Some examples you can try in node's console, but first please declare a `function cb (a,b) { console.log(a,b) }`, that will be handy, then type `thread.eval(\"Math.random()\", cb)` the thread will run that (`Math.random()`) and the `cb(err,result)` will get (and display) a `null (random number)`. A `thread.eval('function hello () { puts(\"Hello!\"); return \"world!\" }', cb)` will eval that in the global context of the thread and thus create a global function hello in the thread's js global context and your `cb(err,result)` will get `null undefined` in the result, `null` because there were no errors and `undefined` because the completion value of a function declaration is `undefined`. On the plus side, now you have injected for the first time in your life some js code of yours in a TAGG's thread and you can tell it to run that, do a `thread.eval('hello()',cb)` and the thread will print `Hello!` in the console and the `cb(err,result)` will receive `world!` into result. How cool is that?\n\n### .on( eventType, listener )\n`thread.on( eventType, listener )` -> thread\n\nRegisters the listener `listener(data [, data2 ... ])` for any events of `eventType` that the thread `thread` may emit. For example, declare a `function cb (a,b,c) { console.log(a,b,c) }` and then do `thread.on(\"event\", cb)`. Now whenever the thread emits an event of the type `event` (which by the way can be any arbitrary name/string you choose), `cb` will be triggered. Let's do that with a `thread.eval('i=5; while (i--) thread.emit(\"event\", \"How\", \"cool\", \"is that?\")')` and the console will display `How cool is that?` five times, huh, unbelievable.\n\n### .once( eventType, listener )\n`thread.once( eventType, listener )` -> thread\n\nLike `thread.on()`, but the listener will only be triggered once.\n\n### .removeAllListeners( [eventType] )\n`thread.removeAllListeners( [eventType] )` -> thread\n\nDeletes all listeners for all eventTypes unless `eventType` is provided, in which case it deletes the listeners only of the event type `eventType`.\n\n### .emit( eventType, eventData [, eventData ... ] )\n`thread.emit( eventType, eventData [, eventData ... ] )` -> thread\n\nEmit an event of `eventType` with `eventData` in the thread `thread`. All its arguments are .toString()ed.\n\n### .destroy( [ rudely ] )\n`thread.destroy( [0 (nicely) | 1 (rudely)] [, cb])` -> undefined\n\nDestroys the thread. If the first parameter is not provided or falsy or 0 (the default) the thread will keep running until both its nextTick/setImmediate queue and its pending `.eval()` jobs queue are empty. If it's truthy or 1 (rudely) the thread's event loop will exit as soon as possible, regardless. If a callback cb (optional) is provided, it will be called when the thread has been killed and completely destroyed, the cb will receive no arguments and the receiver (its 'this') points to the global object. If the thread is stuck in a while (1) ; or similar it won't end and currently tagg has no way around that. At least not yet. Pull requests are very much welcomed, just so you know.\n\n### _on\nIgnore, don't touch that. The `_on` object holds the event listeners.\n\n***\n\n## Thread object API (this is the thread object that exists not in node but as a global in every thread)\n\nInside every thread .create()d by threads_a_gogo, there's a global `thread` object with these properties:\n``` javascript\nthread (a global) ->\n\n{ id: 0,\n  version: '0.1.13',\n  on: [Function: on],\n  once: [Function: once],\n  emit: [Function: emit],\n  removeAllListeners: [Function: removeAllListeners]\n  nextTick: [Function: nextTick],\n  _on: {},\n  _ntq: [] }\n\n```\n### .id\n`thread.id` -> the serial number of this thread.\n\n### .version\n`thread.version` -> A string with the threads_a_gogo version number.\n\n### .on( eventType, listener )\n`thread.on( eventType, listener )` -> thread\n\nJust like `thread.on()` above. But in this case it will receive events emitted by node's main thread, because, remeber, all this exists in the thread's own js context which is totally independent of node's js context.\n\n### .once( eventType, listener )\n`thread.once( eventType, listener )` -> thread\n\nJust like `thread.once()` above.\n\n### .emit( eventType, eventData [, eventData ... ] )\n`thread.emit( eventType, eventData [, eventData ... ] )` -> thread\n\nJust like `thread.emit()` above. What this emits will trigger a listener (if set) in node's main thread.\n\n### .removeAllListeners( [eventType] )\n`thread.removeAllListeners( [eventType] )` -> thread\n\nJust like `thread.removeAllListeners()` above.\n\n### .nextTick( function )\n`thread.nextTick( function )` -> undefined\n\nLike `setImmediate()`, but twice as fast. Every thread runs its own event loop. First it looks for any .eval()s that node may have sent, if there are any it runs the first one, after that it looks in the nextTick/setImmediate queue, if there are any functions there to run, it runs them all (but only in chunks of up to 8192 so that nextTick/setImmediate can never totally block a thread), and then looks again to see if there are any more .eval() events, if there are runs the first one, and repeats this loop forever until there are no more .eval() events nor nextTick/setImmediate functions at which point the thread goes to sleep until any further .eval()s or .emit()s sent from node awake it.\n\n### _on\nIgnore, don't touch that. The `_on` object holds the event listeners.\n\n### _ntq\nIgnore, don't touch that. The `_ntq` array holds the nextTick()ed and/or setImmediate()d funcitons.\n\n***\n\n## Globals in the threads' js contexts\n\nInside every thread .create()d by threads_a_gogo, on top of the usual javascript ones there's these other globals:\n\n### puts(arg1 [, arg2 ...])\n`puts(arg1 [, arg2 ...])` -> undefined\n\n.toString()s and fprintf(stdout)s and fflush(stdout)es its arguments to (you guessed it) stdout.\n\n### setImmediate(function)\n`setImmediate( function )` -> undefined\n\nJust an alias for `thread.nextTick(function)`.\n\n### thread\nThe thread object described above is also a global.\n\n***\n\n## Thread pool API\n``` javascript\npool= tagg.createPool( numbreOfThreads ) ->\n\n{ load: [Function: load],\n  on: [Function: on],\n  any: \n   { eval: [Function: evalAny],\n     emit: [Function: emitAny] },\n  all: \n   { eval: [Function: evalAll],\n     emit: [Function: emitAll] },\n  totalThreads: [Function: getTotalThreads],\n  idleThreads: [Function: getIdleThreads],\n  pendingJobs: [Function: getPendingJobs],\n  destroy: [Function: destroy],\n  pool: \n   [ { load: [Function: load],\n       eval: [Function: eval],\n       emit: [Function: emit],\n       destroy: [Function: destroy],\n       id: 0,\n       version: '0.1.13',\n       on: [Function: on],\n       once: [Function: once],\n       _on: {},\n       removeAllListeners: [Function: removeAllListeners] } ] }\n\n```\n### .load( path [, cb] )\n`pool.load( path [, cb] )` -> pool\n\n`thread.load( path [, cb] )` in every one of the pool's threads. The cb will be called as many times as threads there are.\n\n### .on( eventType, listener )\n`pool.on( eventType, listener )` -> pool\n\nRegisters a listener for events of eventType. Any events of eventType emitted by any thread of the pool will trigger that cb/listener. For example, if you set a `pool.on(\"event\", cb)` and any thread does a `thread.emit(\"event\", \"Hi\", \"there\")`, a `cb(a,b)` will receive \"Hi\" in a and \"There\" in b.\n\n### .any.eval( program, cb )\n`pool.any.eval( program, cb )` -> pool\n\nLike `thread.eval()`, but in any of the pool's threads.\n\n### .any.emit( eventType, eventData [, eventData ... ] )\n`pool.any.emit( eventType, eventData [, eventData ... ] )` -> pool\n\nLike `thread.emit()` but in any of the pool's threads.\n\n### .all.eval( program, cb )\n`pool.all.eval( program, cb )` -> pool\n\nLike `thread.eval()`, but in all the pool's threads.\n\n### .all.emit( eventType, eventData [, eventData ... ] )\n`pool.all.emit( eventType, eventData [, eventData ... ] )` -> pool\n\nLike `thread.emit()` but in all the pool's threads.\n\n### .totalThreads()\n`pool.totalThreads()` -> returns the number of threads in this pool: as supplied in `.createPool( number )`. It's also the same as `pool.pool.length`.\n\n### .idleThreads()\n`pool.idleThreads()` -> returns the number of threads in this pool that are currently idle. Does not work very well currently. Better don't use it.\n\n### .pendingJobs()\n`threadPool.pendingJobs()` -> returns the number of jobs pending. Does not work very well currently. Better don't use it.\n\n### .destroy( [ rudely ] )\n`pool.destroy( [ rudely ] )` -> undefined\n\nIf rudely is 0 or falsy the thread will exit when there aren't any more events in its events queue. If rudely it will quit regardless of that. If stuck in a while (1) ; or similar it won't and currently tagg has no way around that. At least not yet. Pull requests are very much welcomed, just so you know.\n\n### .pool\n`pool.pool` is an array that contains all the threads in the thread pool for your tinkering pleasure.\n\n## Rationale\n\n[Node.js](http://nodejs.org) is the most [awesome, cute and super-sexy](http://javascriptology.com/threads_a_gogo/sexy.jpg) piece of free, open source software.\n\nIts event loop can spin as fast and smooth as a turbo, and roughly speaking, **the faster it spins, the more power it delivers**. That's why [@ryah](http://twitter.com/ryah) took great care to ensure that no -possibly slow- I/O operations could ever block it: a pool of background threads (thanks to [Marc Lehmann's libeio library](http://software.schmorp.de/pkg/libeio.html)) handle any blocking I/O calls in the background, in parallel.\n\nIn Node it's verboten to write a server like this:\n\n``` javascript\nhttp.createServer(function (req,res) {\n  res.end( fs.readFileSync(path) );\n}).listen(port);\n```\nBecause synchronous I/O calls **block the turbo**, and without proper boost, Node.js begins to stutter and behaves clumsily. To avoid it there's the asynchronous version of `.readFile()`, in continuation passing style, that takes a callback:\n\n``` javascript\nfs.readfile(path, function cb (err, data) { /* ... */ });\n```\n\nIt's cool, we love it (*), and there's hundreds of ad hoc built-in functions like this in Node to help us deal with almost any variety of possibly slow, blocking I/O.\n\n### But what's with longish, CPU-bound tasks?\n\nHow do you avoid blocking the event loop, when the task at hand isn't I/O bound, and lasts more than a few fractions of a millisecond?\n\n``` javascript\nhttp.createServer(function cb (req,res) {\n  res.end( fibonacci(40) );\n}).listen(port);\n```\n\nYou simply can't, because there's no way... well, there wasn't before `threads_a_gogo`.\n\n### What is Threads A GoGo for Node.js\n\n`threads_a_gogo` provides the asynchronous API for CPU-bound tasks that's missing in Node.js. Both in continuation passing style (callbacks), and in event emitter style (event listeners).\n\nThe same API Node uses to delegate a longish I/O task to a background (libeio) thread:\n\n`asyncIOTask(what, cb);`\n\n`threads_a_gogo` uses to delegate a longish CPU task to a background (JavaScript) thread:\n\n`thread.eval(program, cb);`\n\nSo with `threads_a_gogo` you can write:\n\n``` javascript\nhttp.createServer(function (req,res) {\n  thread.eval('fibonacci(40)', function cb (err, data) {\n    res.end(data);\n  });\n}).listen(port);\n```\n\nAnd it won't block the event loop because the `fibonacci(40)` will run in parallel in a separate background thread.\n\n\n### Why Threads\n\nThreads (kernel threads) are very interesting creatures. They provide:\n\n1.- Parallelism: All the threads run in parallel. On a single core processor, the CPU is switched rapidly back and forth among the threads providing the illusion that the threads are running in parallel, albeit on a slower CPU than the real one. With 10 compute-bound threads in a process, the threads would appear to be running in parallel, each one on a CPU with 1/10th the speed of the real CPU. On a multi-core processor, threads are truly running in parallel, and get time-sliced when the number of threads exceed the number of cores. So with 12 compute bound threads on a quad-core processor each thread will appear to run at 1/3rd of the nominal core speed.\n\n2.- Fairness: No thread is more important than another, cores and CPU slices are fairly distributed among threads by the OS scheduler.\n\n3.- Threads fully exploit all the available CPU resources in your system. On a loaded system running many tasks in many threads, the more cores there are, the faster the threads will complete. Automatically.\n\n4.- The threads of a process share exactly the same address space, that of the process they belong to. Every thread can access every memory address within the process' address space. This is a very appropriate setup when the threads are actually part of the same job and are actively and closely cooperating with each other. Passing a reference to a chunk of data via a pointer is many orders of magnitude faster than transferring a copy of the data via IPC.\n\n\n### Why not multiple processes.\n\nThe \"can't block the event loop\" problem is inherent to Node's evented model. No matter how many Node processes you have running as a [Node-cluster](http://blog.nodejs.org/2011/10/04/an-easy-way-to-build-scalable-network-programs/), it won't solve its issues with CPU-bound tasks.\n\nLaunch a cluster of N Nodes running the example B (`quickIntro_blocking.js`) above, and all you'll get is N -instead of one- Nodes with their event loops blocked and showing a sluggish performance.\n","maintainers":[{"name":"jorgechamorro","email":"jorge@jorgechamorro.com"}],"time":{"modified":"2022-06-27T06:17:19.019Z","created":"2012-03-10T21:35:19.550Z","0.1.0":"2012-03-10T21:35:22.033Z","0.1.1":"2012-03-13T11:54:40.276Z","0.1.2":"2012-03-21T10:01:35.665Z","0.1.3":"2012-03-23T19:08:55.346Z","0.1.4":"2012-04-09T18:46:27.957Z","0.1.5":"2013-01-30T02:11:17.990Z","0.1.6":"2014-04-07T20:31:53.550Z","0.1.7":"2014-04-07T21:06:00.295Z","0.1.8":"2016-12-22T15:19:55.309Z","0.1.9":"2016-12-22T15:58:55.751Z","0.1.10":"2016-12-23T17:24:32.395Z","0.1.11":"2016-12-23T21:02:40.120Z","0.1.12":"2016-12-24T08:16:30.686Z","0.1.13":"2016-12-30T23:34:41.875Z"},"author":{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/xk/node-threads-a-gogo.git"},"users":{"joliva":true,"sessionbean":true,"godion":true,"nickeljew":true,"mpcref":true,"ys_sidson_aidson":true,"zakdav":true,"touskar":true},"homepage":"https://github.com/xk/node-threads-a-gogo","keywords":["a gogo","ever","project","awesome","most","The"],"contributors":[{"name":"Jorge Chamorro Bieling","email":"jorge@jorgechamorro.com"},{"name":"Bruno Jouhier","email":"bjouhier@gmail.com"},{"name":"IngwiePhoenix","email":"ingwie2000@googlemail.com"}],"bugs":{"url":"http://github.com/xk/node-threads-a-gogo/issues","email":"jorge@jorgechamorro.com"},"readmeFilename":"README.md"}