You can employ a work-queue in such a way that you don't close the original
HTTP request. The HTTP server just hangs onto the connection until a reply
is returned from the worker. Use something like ZeroMQ, or Axon to wire
everything together. For any application that will undergo scaling, this is
a very clean and logical place to separate responsibility.

On Wed, Feb 27, 2013 at 2:05 PM, Tomasz Janczuk <[email protected]> wrote:

> I agree with this argument for long lasting CPU-bound operations (e.g.
> weather prediction). How about CPU-bound operations that can be
> reasonably completed within the lifetime of the original HTTP request?
> It certainly saves a lot of orchestration to have another HTTP request
> retrieve the results at a later time via short or long polling.
>
> On Feb 27, 1:51 pm, Jacob Groundwater <[email protected]> wrote:
> > > 2. Running CPU-bound workloads for node.js applications in-process
> > > (without blocking the node.js event loop):
> > >http://tomasz.janczuk.org/2013/02/cpu-bound-workers-for-nodejs.html
> >
> > Even in an application that supported threading, I would be unlikely to
> run
> > CPU-bound operations in the same process as my HTTP server. Use a worker
> > queue.
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to