Re: [nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread Bradley Meck
Indeed, forgot to mention that, +1 for when you want it in a thread. On Friday, June 29, 2012 9:03:23 AM UTC-5, Bruno Jouhier wrote: > > You can also take a look at https://github.com/xk/node-threads-a-gogo > > It gives you in-process threads to which you can delegate the CPU > intensive tasks. >

Re: [nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread Bruno Jouhier
You can also take a look at https://github.com/xk/node-threads-a-gogo It gives you in-process threads to which you can delegate the CPU intensive tasks. On Friday, June 29, 2012 3:33:32 PM UTC+2, hd nguyen wrote: > > Thanks for your help and explanation. > Everything is quite clearer to me :) >

Re: [nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread hd nguyen
Thanks for your help and explanation. Everything is quite clearer to me :) On Fri, Jun 29, 2012 at 8:27 PM, Bradley Meck wrote: > Usually people use worker pools so they don't spawn up a new process per > request. The moving of heavy computation to other processes has various > advantages and pit

Re: [nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread Bradley Meck
Usually people use worker pools so they don't spawn up a new process per request. The moving of heavy computation to other processes has various advantages and pitfalls ( computation crash for w/e reason can be dealth with, but data must be sent via IPC usually, etc ). I would spawn up a ton o

Re: [nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread Arnout Kazemier
if you have 9 / 10 requests that do heavy computing that node.js is not the language for you. On Friday, June 29, 2012 at 3:07 PM, hd nguyen wrote: > So you guys mean that with each request relate to a heavy computing task, we > should create new process to handle it in NodeJs, right? > > I j

Re: [nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread hd nguyen
So you guys mean that with each request relate to a heavy computing task, we should create new process to handle it in NodeJs, right? I just create those request handler based on this template: module.exports = function(app) { //handler1 app.get('pathname1', function() {}); //handler2

Re: [nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread Ben Noordhuis
On Fri, Jun 29, 2012 at 12:49 PM, hd nguyen wrote: > Hi all, > > I'm new here and want to make a simple test web app with NodeJS and Express > framework. > > I created  2 request are http://localhost:3000/heavycompute (very long time > processing) and http://localhost:3000/ (just display text, ret

[nodejs] Problem in processing 2 request simultaneously

2012-06-29 Thread hd nguyen
Hi all, I'm new here and want to make a simple test web app with NodeJS and Express framework. I created 2 request are http://localhost:3000/heavycompute (very long time processing) and http://localhost:3000/ (just display text, return immediately) and handli