You are reading a single comment by @ChrisB and its replies. Click here to read the full conversation.
  • Using the library is working like this :

    var ac = new async();
    
    console.log('start');
    
    ac.series([
        function(done) {
          console.log('func1 called');
          done(null);
        }
      ],
      function(err, result) {
        console.log('end');
      }
    );
    

    but fails like this

    var ac = new async();
    
    console.log('start');
    
    ac.series([
        function(done) {
          console.log('func1 called');
          done(null);
        },
        function(done) {
          console.log('func2 called');
          done(null);
        }
      ],
      function(err, result) {
        console.log('end');
      }
    );
    

    En error message from Espruino says that it reached the stack limitation for recursivity functions.
    I tried to add a setTimeout(fn(function (err) ...., 0) in this.series to 'empty' the stack.
    I used this trick in some of my code to create recursivity :
    using setTimeout allow the stack to continue the program (and do not fill it) and then call the recursive function. But even with this trick this is not wokring.

    Even if I can make the code working, I'm afraid the board has not enough 'power' or memory.

    What do you think ?

About

Avatar for ChrisB @ChrisB started