I'm trying to achieve a pattern in which I invoke an endless recursive loop of thenables (Promise-based chaining) that are likely to run for several hours (I'm playing around with a little lovefield project).
Basically what I'm trying is this:
runMyRoutine() {
return doThis().then(function() {
return doThat().then(function() {
return runMyRoutine();
});
});
}
Is there some best practice available on this issue (some kind of guideline or a special API to use in that case?)
In terms of feasability it should be possible in my opinion to just keep the above structure, but aren't there memory concerns?
Best regards, lt1