For an application where each request may take a second or two, is it possible to only process a piece of operative code on each iteration of the event loop? For example:
function foo()
{
...operative code...
...start processing the next event here...
...continue with foo() here....
}
Would it be something like this?
function foo()
{
...operative code...
process.nextTick(function() {
...continue with foo() here...
});
}
And if that is the way to do it, does Node automatically start processing whichever event is next in the queue?